1#![doc = "MAVLink paparazzi dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
21#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22#[cfg_attr(feature = "serde", serde(tag = "type"))]
23#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24#[repr(u32)]
25#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
26pub enum ActuatorConfiguration {
27 #[doc = "Do nothing."]
28 ACTUATOR_CONFIGURATION_NONE = 0,
29 #[doc = "Command the actuator to beep now."]
30 ACTUATOR_CONFIGURATION_BEEP = 1,
31 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
32 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
33 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
34 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
35 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
36 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
37 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
38 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
39}
40impl ActuatorConfiguration {
41 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
42}
43impl Default for ActuatorConfiguration {
44 fn default() -> Self {
45 Self::DEFAULT
46 }
47}
48#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
49#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
50#[cfg_attr(feature = "serde", serde(tag = "type"))]
51#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
52#[repr(u32)]
53#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
54pub enum ActuatorOutputFunction {
55 #[doc = "No function (disabled)."]
56 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
57 #[doc = "Motor 1"]
58 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
59 #[doc = "Motor 2"]
60 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
61 #[doc = "Motor 3"]
62 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
63 #[doc = "Motor 4"]
64 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
65 #[doc = "Motor 5"]
66 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
67 #[doc = "Motor 6"]
68 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
69 #[doc = "Motor 7"]
70 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
71 #[doc = "Motor 8"]
72 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
73 #[doc = "Motor 9"]
74 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
75 #[doc = "Motor 10"]
76 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
77 #[doc = "Motor 11"]
78 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
79 #[doc = "Motor 12"]
80 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
81 #[doc = "Motor 13"]
82 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
83 #[doc = "Motor 14"]
84 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
85 #[doc = "Motor 15"]
86 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
87 #[doc = "Motor 16"]
88 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
89 #[doc = "Servo 1"]
90 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
91 #[doc = "Servo 2"]
92 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
93 #[doc = "Servo 3"]
94 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
95 #[doc = "Servo 4"]
96 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
97 #[doc = "Servo 5"]
98 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
99 #[doc = "Servo 6"]
100 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
101 #[doc = "Servo 7"]
102 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
103 #[doc = "Servo 8"]
104 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
105 #[doc = "Servo 9"]
106 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
107 #[doc = "Servo 10"]
108 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
109 #[doc = "Servo 11"]
110 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
111 #[doc = "Servo 12"]
112 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
113 #[doc = "Servo 13"]
114 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
115 #[doc = "Servo 14"]
116 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
117 #[doc = "Servo 15"]
118 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
119 #[doc = "Servo 16"]
120 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
121}
122impl ActuatorOutputFunction {
123 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
124}
125impl Default for ActuatorOutputFunction {
126 fn default() -> Self {
127 Self::DEFAULT
128 }
129}
130#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
132#[cfg_attr(feature = "serde", serde(tag = "type"))]
133#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
134#[repr(u32)]
135#[doc = "Enumeration of the ADSB altimeter types"]
136pub enum AdsbAltitudeType {
137 #[doc = "Altitude reported from a Baro source using QNH reference"]
138 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
139 #[doc = "Altitude reported from a GNSS source"]
140 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
141}
142impl AdsbAltitudeType {
143 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
144}
145impl Default for AdsbAltitudeType {
146 fn default() -> Self {
147 Self::DEFAULT
148 }
149}
150#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
152#[cfg_attr(feature = "serde", serde(tag = "type"))]
153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
154#[repr(u32)]
155#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
156pub enum AdsbEmitterType {
157 ADSB_EMITTER_TYPE_NO_INFO = 0,
158 ADSB_EMITTER_TYPE_LIGHT = 1,
159 ADSB_EMITTER_TYPE_SMALL = 2,
160 ADSB_EMITTER_TYPE_LARGE = 3,
161 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
162 ADSB_EMITTER_TYPE_HEAVY = 5,
163 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
164 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
165 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
166 ADSB_EMITTER_TYPE_GLIDER = 9,
167 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
168 ADSB_EMITTER_TYPE_PARACHUTE = 11,
169 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
170 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
171 ADSB_EMITTER_TYPE_UAV = 14,
172 ADSB_EMITTER_TYPE_SPACE = 15,
173 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
174 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
175 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
176 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
177}
178impl AdsbEmitterType {
179 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
180}
181impl Default for AdsbEmitterType {
182 fn default() -> Self {
183 Self::DEFAULT
184 }
185}
186bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
187impl AdsbFlags {
188 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
189}
190impl Default for AdsbFlags {
191 fn default() -> Self {
192 Self::DEFAULT
193 }
194}
195bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
196impl AisFlags {
197 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
198}
199impl Default for AisFlags {
200 fn default() -> Self {
201 Self::DEFAULT
202 }
203}
204#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
206#[cfg_attr(feature = "serde", serde(tag = "type"))]
207#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
208#[repr(u32)]
209#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
210pub enum AisNavStatus {
211 #[doc = "Under way using engine."]
212 UNDER_WAY = 0,
213 AIS_NAV_ANCHORED = 1,
214 AIS_NAV_UN_COMMANDED = 2,
215 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
216 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
217 AIS_NAV_MOORED = 5,
218 AIS_NAV_AGROUND = 6,
219 AIS_NAV_FISHING = 7,
220 AIS_NAV_SAILING = 8,
221 AIS_NAV_RESERVED_HSC = 9,
222 AIS_NAV_RESERVED_WIG = 10,
223 AIS_NAV_RESERVED_1 = 11,
224 AIS_NAV_RESERVED_2 = 12,
225 AIS_NAV_RESERVED_3 = 13,
226 #[doc = "Search And Rescue Transponder."]
227 AIS_NAV_AIS_SART = 14,
228 #[doc = "Not available (default)."]
229 AIS_NAV_UNKNOWN = 15,
230}
231impl AisNavStatus {
232 pub const DEFAULT: Self = Self::UNDER_WAY;
233}
234impl Default for AisNavStatus {
235 fn default() -> Self {
236 Self::DEFAULT
237 }
238}
239#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
241#[cfg_attr(feature = "serde", serde(tag = "type"))]
242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
243#[repr(u32)]
244#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
245pub enum AisType {
246 #[doc = "Not available (default)."]
247 AIS_TYPE_UNKNOWN = 0,
248 AIS_TYPE_RESERVED_1 = 1,
249 AIS_TYPE_RESERVED_2 = 2,
250 AIS_TYPE_RESERVED_3 = 3,
251 AIS_TYPE_RESERVED_4 = 4,
252 AIS_TYPE_RESERVED_5 = 5,
253 AIS_TYPE_RESERVED_6 = 6,
254 AIS_TYPE_RESERVED_7 = 7,
255 AIS_TYPE_RESERVED_8 = 8,
256 AIS_TYPE_RESERVED_9 = 9,
257 AIS_TYPE_RESERVED_10 = 10,
258 AIS_TYPE_RESERVED_11 = 11,
259 AIS_TYPE_RESERVED_12 = 12,
260 AIS_TYPE_RESERVED_13 = 13,
261 AIS_TYPE_RESERVED_14 = 14,
262 AIS_TYPE_RESERVED_15 = 15,
263 AIS_TYPE_RESERVED_16 = 16,
264 AIS_TYPE_RESERVED_17 = 17,
265 AIS_TYPE_RESERVED_18 = 18,
266 AIS_TYPE_RESERVED_19 = 19,
267 #[doc = "Wing In Ground effect."]
268 AIS_TYPE_WIG = 20,
269 AIS_TYPE_WIG_HAZARDOUS_A = 21,
270 AIS_TYPE_WIG_HAZARDOUS_B = 22,
271 AIS_TYPE_WIG_HAZARDOUS_C = 23,
272 AIS_TYPE_WIG_HAZARDOUS_D = 24,
273 AIS_TYPE_WIG_RESERVED_1 = 25,
274 AIS_TYPE_WIG_RESERVED_2 = 26,
275 AIS_TYPE_WIG_RESERVED_3 = 27,
276 AIS_TYPE_WIG_RESERVED_4 = 28,
277 AIS_TYPE_WIG_RESERVED_5 = 29,
278 AIS_TYPE_FISHING = 30,
279 AIS_TYPE_TOWING = 31,
280 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
281 AIS_TYPE_TOWING_LARGE = 32,
282 #[doc = "Dredging or other underwater ops."]
283 AIS_TYPE_DREDGING = 33,
284 AIS_TYPE_DIVING = 34,
285 AIS_TYPE_MILITARY = 35,
286 AIS_TYPE_SAILING = 36,
287 AIS_TYPE_PLEASURE = 37,
288 AIS_TYPE_RESERVED_20 = 38,
289 AIS_TYPE_RESERVED_21 = 39,
290 #[doc = "High Speed Craft."]
291 AIS_TYPE_HSC = 40,
292 AIS_TYPE_HSC_HAZARDOUS_A = 41,
293 AIS_TYPE_HSC_HAZARDOUS_B = 42,
294 AIS_TYPE_HSC_HAZARDOUS_C = 43,
295 AIS_TYPE_HSC_HAZARDOUS_D = 44,
296 AIS_TYPE_HSC_RESERVED_1 = 45,
297 AIS_TYPE_HSC_RESERVED_2 = 46,
298 AIS_TYPE_HSC_RESERVED_3 = 47,
299 AIS_TYPE_HSC_RESERVED_4 = 48,
300 AIS_TYPE_HSC_UNKNOWN = 49,
301 AIS_TYPE_PILOT = 50,
302 #[doc = "Search And Rescue vessel."]
303 AIS_TYPE_SAR = 51,
304 AIS_TYPE_TUG = 52,
305 AIS_TYPE_PORT_TENDER = 53,
306 #[doc = "Anti-pollution equipment."]
307 AIS_TYPE_ANTI_POLLUTION = 54,
308 AIS_TYPE_LAW_ENFORCEMENT = 55,
309 AIS_TYPE_SPARE_LOCAL_1 = 56,
310 AIS_TYPE_SPARE_LOCAL_2 = 57,
311 AIS_TYPE_MEDICAL_TRANSPORT = 58,
312 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
313 AIS_TYPE_NONECOMBATANT = 59,
314 AIS_TYPE_PASSENGER = 60,
315 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
316 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
317 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
318 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
319 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
320 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
321 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
322 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
323 AIS_TYPE_PASSENGER_UNKNOWN = 69,
324 AIS_TYPE_CARGO = 70,
325 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
326 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
327 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
328 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
329 AIS_TYPE_CARGO_RESERVED_1 = 75,
330 AIS_TYPE_CARGO_RESERVED_2 = 76,
331 AIS_TYPE_CARGO_RESERVED_3 = 77,
332 AIS_TYPE_CARGO_RESERVED_4 = 78,
333 AIS_TYPE_CARGO_UNKNOWN = 79,
334 AIS_TYPE_TANKER = 80,
335 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
336 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
337 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
338 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
339 AIS_TYPE_TANKER_RESERVED_1 = 85,
340 AIS_TYPE_TANKER_RESERVED_2 = 86,
341 AIS_TYPE_TANKER_RESERVED_3 = 87,
342 AIS_TYPE_TANKER_RESERVED_4 = 88,
343 AIS_TYPE_TANKER_UNKNOWN = 89,
344 AIS_TYPE_OTHER = 90,
345 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
346 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
347 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
348 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
349 AIS_TYPE_OTHER_RESERVED_1 = 95,
350 AIS_TYPE_OTHER_RESERVED_2 = 96,
351 AIS_TYPE_OTHER_RESERVED_3 = 97,
352 AIS_TYPE_OTHER_RESERVED_4 = 98,
353 AIS_TYPE_OTHER_UNKNOWN = 99,
354}
355impl AisType {
356 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
357}
358impl Default for AisType {
359 fn default() -> Self {
360 Self::DEFAULT
361 }
362}
363bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
364impl AttitudeTargetTypemask {
365 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
366}
367impl Default for AttitudeTargetTypemask {
368 fn default() -> Self {
369 Self::DEFAULT
370 }
371}
372#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
374#[cfg_attr(feature = "serde", serde(tag = "type"))]
375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
376#[repr(u32)]
377#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
378pub enum AutotuneAxis {
379 #[doc = "Autotune roll axis."]
380 AUTOTUNE_AXIS_ROLL = 1,
381 #[doc = "Autotune pitch axis."]
382 AUTOTUNE_AXIS_PITCH = 2,
383 #[doc = "Autotune yaw axis."]
384 AUTOTUNE_AXIS_YAW = 4,
385}
386impl AutotuneAxis {
387 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
388}
389impl Default for AutotuneAxis {
390 fn default() -> Self {
391 Self::DEFAULT
392 }
393}
394bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
395impl CameraCapFlags {
396 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
397}
398impl Default for CameraCapFlags {
399 fn default() -> Self {
400 Self::DEFAULT
401 }
402}
403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
405#[cfg_attr(feature = "serde", serde(tag = "type"))]
406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
407#[repr(u32)]
408#[doc = "Camera Modes."]
409pub enum CameraMode {
410 #[doc = "Camera is in image/photo capture mode."]
411 CAMERA_MODE_IMAGE = 0,
412 #[doc = "Camera is in video capture mode."]
413 CAMERA_MODE_VIDEO = 1,
414 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
415 CAMERA_MODE_IMAGE_SURVEY = 2,
416}
417impl CameraMode {
418 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
419}
420impl Default for CameraMode {
421 fn default() -> Self {
422 Self::DEFAULT
423 }
424}
425#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
427#[cfg_attr(feature = "serde", serde(tag = "type"))]
428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
429#[repr(u32)]
430#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
431pub enum CameraSource {
432 #[doc = "Default camera source."]
433 CAMERA_SOURCE_DEFAULT = 0,
434 #[doc = "RGB camera source."]
435 CAMERA_SOURCE_RGB = 1,
436 #[doc = "IR camera source."]
437 CAMERA_SOURCE_IR = 2,
438 #[doc = "NDVI camera source."]
439 CAMERA_SOURCE_NDVI = 3,
440}
441impl CameraSource {
442 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
443}
444impl Default for CameraSource {
445 fn default() -> Self {
446 Self::DEFAULT
447 }
448}
449#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
451#[cfg_attr(feature = "serde", serde(tag = "type"))]
452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
453#[repr(u32)]
454#[doc = "Camera tracking modes"]
455pub enum CameraTrackingMode {
456 #[doc = "Not tracking"]
457 CAMERA_TRACKING_MODE_NONE = 0,
458 #[doc = "Target is a point"]
459 CAMERA_TRACKING_MODE_POINT = 1,
460 #[doc = "Target is a rectangle"]
461 CAMERA_TRACKING_MODE_RECTANGLE = 2,
462}
463impl CameraTrackingMode {
464 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
465}
466impl Default for CameraTrackingMode {
467 fn default() -> Self {
468 Self::DEFAULT
469 }
470}
471#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
472#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
473#[cfg_attr(feature = "serde", serde(tag = "type"))]
474#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
475#[repr(u32)]
476#[doc = "Camera tracking status flags"]
477pub enum CameraTrackingStatusFlags {
478 #[doc = "Camera is not tracking"]
479 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
480 #[doc = "Camera is tracking"]
481 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
482 #[doc = "Camera tracking in error state"]
483 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
484}
485impl CameraTrackingStatusFlags {
486 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
487}
488impl Default for CameraTrackingStatusFlags {
489 fn default() -> Self {
490 Self::DEFAULT
491 }
492}
493bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
494impl CameraTrackingTargetData {
495 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
496}
497impl Default for CameraTrackingTargetData {
498 fn default() -> Self {
499 Self::DEFAULT
500 }
501}
502#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
503#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
504#[cfg_attr(feature = "serde", serde(tag = "type"))]
505#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
506#[repr(u32)]
507#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
508pub enum CameraZoomType {
509 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
510 ZOOM_TYPE_STEP = 0,
511 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
512 ZOOM_TYPE_CONTINUOUS = 1,
513 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
514 ZOOM_TYPE_RANGE = 2,
515 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
516 ZOOM_TYPE_FOCAL_LENGTH = 3,
517 #[doc = "Zoom value as horizontal field of view in degrees."]
518 ZOOM_TYPE_HORIZONTAL_FOV = 4,
519}
520impl CameraZoomType {
521 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
522}
523impl Default for CameraZoomType {
524 fn default() -> Self {
525 Self::DEFAULT
526 }
527}
528#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
529#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
530#[cfg_attr(feature = "serde", serde(tag = "type"))]
531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
532#[repr(u32)]
533pub enum CanFilterOp {
534 CAN_FILTER_REPLACE = 0,
535 CAN_FILTER_ADD = 1,
536 CAN_FILTER_REMOVE = 2,
537}
538impl CanFilterOp {
539 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
540}
541impl Default for CanFilterOp {
542 fn default() -> Self {
543 Self::DEFAULT
544 }
545}
546#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
547#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
548#[cfg_attr(feature = "serde", serde(tag = "type"))]
549#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
550#[repr(u32)]
551#[doc = "Possible responses from a CELLULAR_CONFIG message."]
552pub enum CellularConfigResponse {
553 #[doc = "Changes accepted."]
554 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
555 #[doc = "Invalid APN."]
556 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
557 #[doc = "Invalid PIN."]
558 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
559 #[doc = "Changes rejected."]
560 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
561 #[doc = "PUK is required to unblock SIM card."]
562 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
563}
564impl CellularConfigResponse {
565 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
566}
567impl Default for CellularConfigResponse {
568 fn default() -> Self {
569 Self::DEFAULT
570 }
571}
572#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
574#[cfg_attr(feature = "serde", serde(tag = "type"))]
575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
576#[repr(u32)]
577#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
578pub enum CellularNetworkFailedReason {
579 #[doc = "No error"]
580 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
581 #[doc = "Error state is unknown"]
582 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
583 #[doc = "SIM is required for the modem but missing"]
584 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
585 #[doc = "SIM is available, but not usable for connection"]
586 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
587}
588impl CellularNetworkFailedReason {
589 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
590}
591impl Default for CellularNetworkFailedReason {
592 fn default() -> Self {
593 Self::DEFAULT
594 }
595}
596#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
597#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
598#[cfg_attr(feature = "serde", serde(tag = "type"))]
599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
600#[repr(u32)]
601#[doc = "Cellular network radio type"]
602pub enum CellularNetworkRadioType {
603 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
604 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
605 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
606 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
607 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
608}
609impl CellularNetworkRadioType {
610 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
611}
612impl Default for CellularNetworkRadioType {
613 fn default() -> Self {
614 Self::DEFAULT
615 }
616}
617#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
618#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
619#[cfg_attr(feature = "serde", serde(tag = "type"))]
620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
621#[repr(u32)]
622#[doc = "These flags encode the cellular network status"]
623pub enum CellularStatusFlag {
624 #[doc = "State unknown or not reportable."]
625 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
626 #[doc = "Modem is unusable"]
627 CELLULAR_STATUS_FLAG_FAILED = 1,
628 #[doc = "Modem is being initialized"]
629 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
630 #[doc = "Modem is locked"]
631 CELLULAR_STATUS_FLAG_LOCKED = 3,
632 #[doc = "Modem is not enabled and is powered down"]
633 CELLULAR_STATUS_FLAG_DISABLED = 4,
634 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
635 CELLULAR_STATUS_FLAG_DISABLING = 5,
636 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
637 CELLULAR_STATUS_FLAG_ENABLING = 6,
638 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
639 CELLULAR_STATUS_FLAG_ENABLED = 7,
640 #[doc = "Modem is searching for a network provider to register"]
641 CELLULAR_STATUS_FLAG_SEARCHING = 8,
642 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
643 CELLULAR_STATUS_FLAG_REGISTERED = 9,
644 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
645 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
646 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
647 CELLULAR_STATUS_FLAG_CONNECTING = 11,
648 #[doc = "One or more packet data bearers is active and connected"]
649 CELLULAR_STATUS_FLAG_CONNECTED = 12,
650}
651impl CellularStatusFlag {
652 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
653}
654impl Default for CellularStatusFlag {
655 fn default() -> Self {
656 Self::DEFAULT
657 }
658}
659#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
660#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
661#[cfg_attr(feature = "serde", serde(tag = "type"))]
662#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
663#[repr(u32)]
664#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
665pub enum CompMetadataType {
666 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
667 COMP_METADATA_TYPE_GENERAL = 0,
668 #[doc = "Parameter meta data."]
669 COMP_METADATA_TYPE_PARAMETER = 1,
670 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
671 COMP_METADATA_TYPE_COMMANDS = 2,
672 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
673 COMP_METADATA_TYPE_PERIPHERALS = 3,
674 #[doc = "Meta data for the events interface."]
675 COMP_METADATA_TYPE_EVENTS = 4,
676 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
677 COMP_METADATA_TYPE_ACTUATORS = 5,
678}
679impl CompMetadataType {
680 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
681}
682impl Default for CompMetadataType {
683 fn default() -> Self {
684 Self::DEFAULT
685 }
686}
687#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
689#[cfg_attr(feature = "serde", serde(tag = "type"))]
690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
691#[repr(u32)]
692#[doc = "Indicates the ESC connection type."]
693pub enum EscConnectionType {
694 #[doc = "Traditional PPM ESC."]
695 ESC_CONNECTION_TYPE_PPM = 0,
696 #[doc = "Serial Bus connected ESC."]
697 ESC_CONNECTION_TYPE_SERIAL = 1,
698 #[doc = "One Shot PPM ESC."]
699 ESC_CONNECTION_TYPE_ONESHOT = 2,
700 #[doc = "I2C ESC."]
701 ESC_CONNECTION_TYPE_I2C = 3,
702 #[doc = "CAN-Bus ESC."]
703 ESC_CONNECTION_TYPE_CAN = 4,
704 #[doc = "DShot ESC."]
705 ESC_CONNECTION_TYPE_DSHOT = 5,
706}
707impl EscConnectionType {
708 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
709}
710impl Default for EscConnectionType {
711 fn default() -> Self {
712 Self::DEFAULT
713 }
714}
715bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
716impl EscFailureFlags {
717 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
718}
719impl Default for EscFailureFlags {
720 fn default() -> Self {
721 Self::DEFAULT
722 }
723}
724bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
725impl EstimatorStatusFlags {
726 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
727}
728impl Default for EstimatorStatusFlags {
729 fn default() -> Self {
730 Self::DEFAULT
731 }
732}
733#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
735#[cfg_attr(feature = "serde", serde(tag = "type"))]
736#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
737#[repr(u32)]
738#[doc = "List of possible failure type to inject."]
739pub enum FailureType {
740 #[doc = "No failure injected, used to reset a previous failure."]
741 FAILURE_TYPE_OK = 0,
742 #[doc = "Sets unit off, so completely non-responsive."]
743 FAILURE_TYPE_OFF = 1,
744 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
745 FAILURE_TYPE_STUCK = 2,
746 #[doc = "Unit is reporting complete garbage."]
747 FAILURE_TYPE_GARBAGE = 3,
748 #[doc = "Unit is consistently wrong."]
749 FAILURE_TYPE_WRONG = 4,
750 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
751 FAILURE_TYPE_SLOW = 5,
752 #[doc = "Data of unit is delayed in time."]
753 FAILURE_TYPE_DELAYED = 6,
754 #[doc = "Unit is sometimes working, sometimes not."]
755 FAILURE_TYPE_INTERMITTENT = 7,
756}
757impl FailureType {
758 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
759}
760impl Default for FailureType {
761 fn default() -> Self {
762 Self::DEFAULT
763 }
764}
765#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
767#[cfg_attr(feature = "serde", serde(tag = "type"))]
768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
769#[repr(u32)]
770#[doc = "List of possible units where failures can be injected."]
771pub enum FailureUnit {
772 FAILURE_UNIT_SENSOR_GYRO = 0,
773 FAILURE_UNIT_SENSOR_ACCEL = 1,
774 FAILURE_UNIT_SENSOR_MAG = 2,
775 FAILURE_UNIT_SENSOR_BARO = 3,
776 FAILURE_UNIT_SENSOR_GPS = 4,
777 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
778 FAILURE_UNIT_SENSOR_VIO = 6,
779 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
780 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
781 FAILURE_UNIT_SYSTEM_BATTERY = 100,
782 FAILURE_UNIT_SYSTEM_MOTOR = 101,
783 FAILURE_UNIT_SYSTEM_SERVO = 102,
784 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
785 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
786 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
787}
788impl FailureUnit {
789 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
790}
791impl Default for FailureUnit {
792 fn default() -> Self {
793 Self::DEFAULT
794 }
795}
796#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
797#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
798#[cfg_attr(feature = "serde", serde(tag = "type"))]
799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
800#[repr(u32)]
801pub enum FenceBreach {
802 #[doc = "No last fence breach"]
803 FENCE_BREACH_NONE = 0,
804 #[doc = "Breached minimum altitude"]
805 FENCE_BREACH_MINALT = 1,
806 #[doc = "Breached maximum altitude"]
807 FENCE_BREACH_MAXALT = 2,
808 #[doc = "Breached fence boundary"]
809 FENCE_BREACH_BOUNDARY = 3,
810}
811impl FenceBreach {
812 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
813}
814impl Default for FenceBreach {
815 fn default() -> Self {
816 Self::DEFAULT
817 }
818}
819#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
821#[cfg_attr(feature = "serde", serde(tag = "type"))]
822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
823#[repr(u32)]
824#[doc = "Actions being taken to mitigate/prevent fence breach"]
825pub enum FenceMitigate {
826 #[doc = "Unknown"]
827 FENCE_MITIGATE_UNKNOWN = 0,
828 #[doc = "No actions being taken"]
829 FENCE_MITIGATE_NONE = 1,
830 #[doc = "Velocity limiting active to prevent breach"]
831 FENCE_MITIGATE_VEL_LIMIT = 2,
832}
833impl FenceMitigate {
834 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
835}
836impl Default for FenceMitigate {
837 fn default() -> Self {
838 Self::DEFAULT
839 }
840}
841#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
843#[cfg_attr(feature = "serde", serde(tag = "type"))]
844#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
845#[repr(u32)]
846#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
847pub enum FenceType {
848 #[doc = "Maximum altitude fence"]
849 FENCE_TYPE_ALT_MAX = 1,
850 #[doc = "Circle fence"]
851 FENCE_TYPE_CIRCLE = 2,
852 #[doc = "Polygon fence"]
853 FENCE_TYPE_POLYGON = 4,
854 #[doc = "Minimum altitude fence"]
855 FENCE_TYPE_ALT_MIN = 8,
856}
857impl FenceType {
858 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
859}
860impl Default for FenceType {
861 fn default() -> Self {
862 Self::DEFAULT
863 }
864}
865#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
867#[cfg_attr(feature = "serde", serde(tag = "type"))]
868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
869#[repr(u32)]
870#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
871pub enum FirmwareVersionType {
872 #[doc = "development release"]
873 FIRMWARE_VERSION_TYPE_DEV = 0,
874 #[doc = "alpha release"]
875 FIRMWARE_VERSION_TYPE_ALPHA = 64,
876 #[doc = "beta release"]
877 FIRMWARE_VERSION_TYPE_BETA = 128,
878 #[doc = "release candidate"]
879 FIRMWARE_VERSION_TYPE_RC = 192,
880 #[doc = "official stable release"]
881 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
882}
883impl FirmwareVersionType {
884 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
885}
886impl Default for FirmwareVersionType {
887 fn default() -> Self {
888 Self::DEFAULT
889 }
890}
891bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
892impl GimbalDeviceCapFlags {
893 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
894}
895impl Default for GimbalDeviceCapFlags {
896 fn default() -> Self {
897 Self::DEFAULT
898 }
899}
900bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
901impl GimbalDeviceErrorFlags {
902 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
903}
904impl Default for GimbalDeviceErrorFlags {
905 fn default() -> Self {
906 Self::DEFAULT
907 }
908}
909bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
910impl GimbalDeviceFlags {
911 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
912}
913impl Default for GimbalDeviceFlags {
914 fn default() -> Self {
915 Self::DEFAULT
916 }
917}
918bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
919impl GimbalManagerCapFlags {
920 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
921}
922impl Default for GimbalManagerCapFlags {
923 fn default() -> Self {
924 Self::DEFAULT
925 }
926}
927bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
928impl GimbalManagerFlags {
929 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
930}
931impl Default for GimbalManagerFlags {
932 fn default() -> Self {
933 Self::DEFAULT
934 }
935}
936#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
938#[cfg_attr(feature = "serde", serde(tag = "type"))]
939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
940#[repr(u32)]
941#[doc = "Type of GPS fix"]
942pub enum GpsFixType {
943 #[doc = "No GPS connected"]
944 GPS_FIX_TYPE_NO_GPS = 0,
945 #[doc = "No position information, GPS is connected"]
946 GPS_FIX_TYPE_NO_FIX = 1,
947 #[doc = "2D position"]
948 GPS_FIX_TYPE_2D_FIX = 2,
949 #[doc = "3D position"]
950 GPS_FIX_TYPE_3D_FIX = 3,
951 #[doc = "DGPS/SBAS aided 3D position"]
952 GPS_FIX_TYPE_DGPS = 4,
953 #[doc = "RTK float, 3D position"]
954 GPS_FIX_TYPE_RTK_FLOAT = 5,
955 #[doc = "RTK Fixed, 3D position"]
956 GPS_FIX_TYPE_RTK_FIXED = 6,
957 #[doc = "Static fixed, typically used for base stations"]
958 GPS_FIX_TYPE_STATIC = 7,
959 #[doc = "PPP, 3D position."]
960 GPS_FIX_TYPE_PPP = 8,
961}
962impl GpsFixType {
963 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
964}
965impl Default for GpsFixType {
966 fn default() -> Self {
967 Self::DEFAULT
968 }
969}
970bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
971impl GpsInputIgnoreFlags {
972 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
973}
974impl Default for GpsInputIgnoreFlags {
975 fn default() -> Self {
976 Self::DEFAULT
977 }
978}
979#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
980#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
981#[cfg_attr(feature = "serde", serde(tag = "type"))]
982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
983#[repr(u32)]
984#[doc = "Gripper actions."]
985pub enum GripperActions {
986 #[doc = "Gripper release cargo."]
987 GRIPPER_ACTION_RELEASE = 0,
988 #[doc = "Gripper grab onto cargo."]
989 GRIPPER_ACTION_GRAB = 1,
990}
991impl GripperActions {
992 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
993}
994impl Default for GripperActions {
995 fn default() -> Self {
996 Self::DEFAULT
997 }
998}
999bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1000impl HighresImuUpdatedFlags {
1001 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1002}
1003impl Default for HighresImuUpdatedFlags {
1004 fn default() -> Self {
1005 Self::DEFAULT
1006 }
1007}
1008bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1009impl HilActuatorControlsFlags {
1010 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1011}
1012impl Default for HilActuatorControlsFlags {
1013 fn default() -> Self {
1014 Self::DEFAULT
1015 }
1016}
1017bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1018impl HilSensorUpdatedFlags {
1019 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1020}
1021impl Default for HilSensorUpdatedFlags {
1022 fn default() -> Self {
1023 Self::DEFAULT
1024 }
1025}
1026bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1027impl HlFailureFlag {
1028 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1029}
1030impl Default for HlFailureFlag {
1031 fn default() -> Self {
1032 Self::DEFAULT
1033 }
1034}
1035bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1036impl IlluminatorErrorFlags {
1037 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1038}
1039impl Default for IlluminatorErrorFlags {
1040 fn default() -> Self {
1041 Self::DEFAULT
1042 }
1043}
1044#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1046#[cfg_attr(feature = "serde", serde(tag = "type"))]
1047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1048#[repr(u32)]
1049#[doc = "Modes of illuminator"]
1050pub enum IlluminatorMode {
1051 #[doc = "Illuminator mode is not specified/unknown"]
1052 ILLUMINATOR_MODE_UNKNOWN = 0,
1053 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1054 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1055 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1056 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1057}
1058impl IlluminatorMode {
1059 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1060}
1061impl Default for IlluminatorMode {
1062 fn default() -> Self {
1063 Self::DEFAULT
1064 }
1065}
1066#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1067#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1068#[cfg_attr(feature = "serde", serde(tag = "type"))]
1069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1070#[repr(u32)]
1071#[doc = "Type of landing target"]
1072pub enum LandingTargetType {
1073 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1074 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1075 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1076 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1077 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1078 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1079 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1080 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1081}
1082impl LandingTargetType {
1083 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1084}
1085impl Default for LandingTargetType {
1086 fn default() -> Self {
1087 Self::DEFAULT
1088 }
1089}
1090#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1092#[cfg_attr(feature = "serde", serde(tag = "type"))]
1093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1094#[repr(u32)]
1095pub enum MagCalStatus {
1096 MAG_CAL_NOT_STARTED = 0,
1097 MAG_CAL_WAITING_TO_START = 1,
1098 MAG_CAL_RUNNING_STEP_ONE = 2,
1099 MAG_CAL_RUNNING_STEP_TWO = 3,
1100 MAG_CAL_SUCCESS = 4,
1101 MAG_CAL_FAILED = 5,
1102 MAG_CAL_BAD_ORIENTATION = 6,
1103 MAG_CAL_BAD_RADIUS = 7,
1104}
1105impl MagCalStatus {
1106 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1107}
1108impl Default for MagCalStatus {
1109 fn default() -> Self {
1110 Self::DEFAULT
1111 }
1112}
1113#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1115#[cfg_attr(feature = "serde", serde(tag = "type"))]
1116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1117#[repr(u32)]
1118pub enum MavArmAuthDeniedReason {
1119 #[doc = "Not a specific reason"]
1120 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1121 #[doc = "Authorizer will send the error as string to GCS"]
1122 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1123 #[doc = "At least one waypoint have a invalid value"]
1124 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1125 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1126 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1127 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1128 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1129 #[doc = "Weather is not good to fly"]
1130 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1131}
1132impl MavArmAuthDeniedReason {
1133 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1134}
1135impl Default for MavArmAuthDeniedReason {
1136 fn default() -> Self {
1137 Self::DEFAULT
1138 }
1139}
1140#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1141#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1142#[cfg_attr(feature = "serde", serde(tag = "type"))]
1143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1144#[repr(u32)]
1145#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1146pub enum MavAutopilot {
1147 #[doc = "Generic autopilot, full support for everything"]
1148 MAV_AUTOPILOT_GENERIC = 0,
1149 #[doc = "Reserved for future use."]
1150 MAV_AUTOPILOT_RESERVED = 1,
1151 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1152 MAV_AUTOPILOT_SLUGS = 2,
1153 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1154 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1155 #[doc = "OpenPilot, <http://openpilot.org>"]
1156 MAV_AUTOPILOT_OPENPILOT = 4,
1157 #[doc = "Generic autopilot only supporting simple waypoints"]
1158 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1159 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1160 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1161 #[doc = "Generic autopilot supporting the full mission command set"]
1162 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1163 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1164 MAV_AUTOPILOT_INVALID = 8,
1165 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1166 MAV_AUTOPILOT_PPZ = 9,
1167 #[doc = "UAV Dev Board"]
1168 MAV_AUTOPILOT_UDB = 10,
1169 #[doc = "FlexiPilot"]
1170 MAV_AUTOPILOT_FP = 11,
1171 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1172 MAV_AUTOPILOT_PX4 = 12,
1173 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1174 MAV_AUTOPILOT_SMACCMPILOT = 13,
1175 #[doc = "AutoQuad -- <http://autoquad.org>"]
1176 MAV_AUTOPILOT_AUTOQUAD = 14,
1177 #[doc = "Armazila -- <http://armazila.com>"]
1178 MAV_AUTOPILOT_ARMAZILA = 15,
1179 #[doc = "Aerob -- <http://aerob.ru>"]
1180 MAV_AUTOPILOT_AEROB = 16,
1181 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1182 MAV_AUTOPILOT_ASLUAV = 17,
1183 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1184 MAV_AUTOPILOT_SMARTAP = 18,
1185 #[doc = "AirRails - <http://uaventure.com>"]
1186 MAV_AUTOPILOT_AIRRAILS = 19,
1187 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1188 MAV_AUTOPILOT_REFLEX = 20,
1189}
1190impl MavAutopilot {
1191 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1192}
1193impl Default for MavAutopilot {
1194 fn default() -> Self {
1195 Self::DEFAULT
1196 }
1197}
1198#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1200#[cfg_attr(feature = "serde", serde(tag = "type"))]
1201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1202#[repr(u32)]
1203#[doc = "Enumeration for battery charge states."]
1204pub enum MavBatteryChargeState {
1205 #[doc = "Low battery state is not provided"]
1206 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1207 #[doc = "Battery is not in low state. Normal operation."]
1208 MAV_BATTERY_CHARGE_STATE_OK = 1,
1209 #[doc = "Battery state is low, warn and monitor close."]
1210 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1211 #[doc = "Battery state is critical, return or abort immediately."]
1212 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1213 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1214 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1215 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1216 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1217 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1218 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1219 #[doc = "Battery is charging."]
1220 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1221}
1222impl MavBatteryChargeState {
1223 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1224}
1225impl Default for MavBatteryChargeState {
1226 fn default() -> Self {
1227 Self::DEFAULT
1228 }
1229}
1230bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1231impl MavBatteryFault {
1232 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1233}
1234impl Default for MavBatteryFault {
1235 fn default() -> Self {
1236 Self::DEFAULT
1237 }
1238}
1239#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1241#[cfg_attr(feature = "serde", serde(tag = "type"))]
1242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1243#[repr(u32)]
1244#[doc = "Enumeration of battery functions"]
1245pub enum MavBatteryFunction {
1246 #[doc = "Battery function is unknown"]
1247 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1248 #[doc = "Battery supports all flight systems"]
1249 MAV_BATTERY_FUNCTION_ALL = 1,
1250 #[doc = "Battery for the propulsion system"]
1251 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1252 #[doc = "Avionics battery"]
1253 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1254 #[doc = "Payload battery"]
1255 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1256}
1257impl MavBatteryFunction {
1258 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1259}
1260impl Default for MavBatteryFunction {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1266#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1267#[cfg_attr(feature = "serde", serde(tag = "type"))]
1268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1269#[repr(u32)]
1270#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1271pub enum MavBatteryMode {
1272 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1273 MAV_BATTERY_MODE_UNKNOWN = 0,
1274 #[doc = "Battery is auto discharging (towards storage level)."]
1275 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1276 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1277 MAV_BATTERY_MODE_HOT_SWAP = 2,
1278}
1279impl MavBatteryMode {
1280 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1281}
1282impl Default for MavBatteryMode {
1283 fn default() -> Self {
1284 Self::DEFAULT
1285 }
1286}
1287#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1289#[cfg_attr(feature = "serde", serde(tag = "type"))]
1290#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1291#[repr(u32)]
1292#[doc = "Enumeration of battery types"]
1293pub enum MavBatteryType {
1294 #[doc = "Not specified."]
1295 MAV_BATTERY_TYPE_UNKNOWN = 0,
1296 #[doc = "Lithium polymer battery"]
1297 MAV_BATTERY_TYPE_LIPO = 1,
1298 #[doc = "Lithium-iron-phosphate battery"]
1299 MAV_BATTERY_TYPE_LIFE = 2,
1300 #[doc = "Lithium-ION battery"]
1301 MAV_BATTERY_TYPE_LION = 3,
1302 #[doc = "Nickel metal hydride battery"]
1303 MAV_BATTERY_TYPE_NIMH = 4,
1304}
1305impl MavBatteryType {
1306 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1307}
1308impl Default for MavBatteryType {
1309 fn default() -> Self {
1310 Self::DEFAULT
1311 }
1312}
1313#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1314#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1315#[cfg_attr(feature = "serde", serde(tag = "type"))]
1316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1317#[repr(u32)]
1318#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1319pub enum MavCmd {
1320 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1321 MAV_CMD_NAV_WAYPOINT = 16,
1322 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1323 MAV_CMD_NAV_LOITER_UNLIM = 17,
1324 #[doc = "Loiter around this waypoint for X turns"]
1325 MAV_CMD_NAV_LOITER_TURNS = 18,
1326 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1327 MAV_CMD_NAV_LOITER_TIME = 19,
1328 #[doc = "Return to launch location"]
1329 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1330 #[doc = "Land at location."]
1331 MAV_CMD_NAV_LAND = 21,
1332 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1333 MAV_CMD_NAV_TAKEOFF = 22,
1334 #[doc = "Land at local position (local frame only)"]
1335 MAV_CMD_NAV_LAND_LOCAL = 23,
1336 #[doc = "Takeoff from local position (local frame only)"]
1337 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1338 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1339 MAV_CMD_NAV_FOLLOW = 25,
1340 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1341 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1342 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1343 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1344 #[doc = "Begin following a target"]
1345 MAV_CMD_DO_FOLLOW = 32,
1346 #[doc = "Reposition the MAV after a follow target command has been sent"]
1347 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1348 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1349 MAV_CMD_DO_ORBIT = 34,
1350 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1351 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1352 MAV_CMD_NAV_ROI = 80,
1353 #[doc = "Control autonomous path planning on the MAV."]
1354 MAV_CMD_NAV_PATHPLANNING = 81,
1355 #[doc = "Navigate to waypoint using a spline path."]
1356 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1357 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1358 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1359 #[doc = "Land using VTOL mode"]
1360 MAV_CMD_NAV_VTOL_LAND = 85,
1361 #[doc = "hand control over to an external controller"]
1362 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1363 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1364 MAV_CMD_NAV_DELAY = 93,
1365 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1366 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1367 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1368 MAV_CMD_NAV_LAST = 95,
1369 #[doc = "Delay mission state machine."]
1370 MAV_CMD_CONDITION_DELAY = 112,
1371 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1372 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1373 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1374 MAV_CMD_CONDITION_DISTANCE = 114,
1375 #[doc = "Reach a certain target angle."]
1376 MAV_CMD_CONDITION_YAW = 115,
1377 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1378 MAV_CMD_CONDITION_LAST = 159,
1379 #[doc = "Set system mode."]
1380 MAV_CMD_DO_SET_MODE = 176,
1381 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1382 MAV_CMD_DO_JUMP = 177,
1383 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1384 MAV_CMD_DO_CHANGE_SPEED = 178,
1385 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1386 MAV_CMD_DO_SET_HOME = 179,
1387 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1388 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1389 MAV_CMD_DO_SET_PARAMETER = 180,
1390 #[doc = "Set a relay to a condition."]
1391 MAV_CMD_DO_SET_RELAY = 181,
1392 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1393 MAV_CMD_DO_REPEAT_RELAY = 182,
1394 #[doc = "Set a servo to a desired PWM value."]
1395 MAV_CMD_DO_SET_SERVO = 183,
1396 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1397 MAV_CMD_DO_REPEAT_SERVO = 184,
1398 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1399 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1400 #[doc = "Change altitude set point."]
1401 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1402 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1403 MAV_CMD_DO_SET_ACTUATOR = 187,
1404 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1405 MAV_CMD_DO_RETURN_PATH_START = 188,
1406 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1407 MAV_CMD_DO_LAND_START = 189,
1408 #[doc = "Mission command to perform a landing from a rally point."]
1409 MAV_CMD_DO_RALLY_LAND = 190,
1410 #[doc = "Mission command to safely abort an autonomous landing."]
1411 MAV_CMD_DO_GO_AROUND = 191,
1412 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1413 MAV_CMD_DO_REPOSITION = 192,
1414 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1415 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1416 #[doc = "Set moving direction to forward or reverse."]
1417 MAV_CMD_DO_SET_REVERSE = 194,
1418 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1419 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1420 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1421 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1422 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1423 MAV_CMD_DO_SET_ROI_NONE = 197,
1424 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1425 MAV_CMD_DO_SET_ROI_SYSID = 198,
1426 #[doc = "Control onboard camera system."]
1427 MAV_CMD_DO_CONTROL_VIDEO = 200,
1428 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1429 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1430 MAV_CMD_DO_SET_ROI = 201,
1431 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1432 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1433 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1434 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1435 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1436 #[doc = "Mission command to configure a camera or antenna mount"]
1437 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1438 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1439 #[doc = "Mission command to control a camera or antenna mount"]
1440 MAV_CMD_DO_MOUNT_CONTROL = 205,
1441 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1442 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1443 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1444 MAV_CMD_DO_FENCE_ENABLE = 207,
1445 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1446 MAV_CMD_DO_PARACHUTE = 208,
1447 #[doc = "Command to perform motor test."]
1448 MAV_CMD_DO_MOTOR_TEST = 209,
1449 #[doc = "Change to/from inverted flight."]
1450 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1451 #[doc = "Mission command to operate a gripper."]
1452 MAV_CMD_DO_GRIPPER = 211,
1453 #[doc = "Enable/disable autotune."]
1454 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1455 #[doc = "Sets a desired vehicle turn angle and speed change."]
1456 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1457 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1458 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1459 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1460 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1461 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1462 #[doc = "set id of master controller"]
1463 MAV_CMD_DO_GUIDED_MASTER = 221,
1464 #[doc = "Set limits for external control"]
1465 MAV_CMD_DO_GUIDED_LIMITS = 222,
1466 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1467 MAV_CMD_DO_ENGINE_CONTROL = 223,
1468 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1469 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1470 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1471 MAV_CMD_DO_LAST = 240,
1472 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1473 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1474 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1475 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1476 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1477 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1478 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1479 MAV_CMD_PREFLIGHT_STORAGE = 245,
1480 #[doc = "Request the reboot or shutdown of system components."]
1481 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1482 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1483 MAV_CMD_OVERRIDE_GOTO = 252,
1484 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1485 MAV_CMD_OBLIQUE_SURVEY = 260,
1486 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1487 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1488 #[doc = "start running a mission"]
1489 MAV_CMD_MISSION_START = 300,
1490 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1491 MAV_CMD_ACTUATOR_TEST = 310,
1492 #[doc = "Actuator configuration command."]
1493 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1494 #[doc = "Arms / Disarms a component"]
1495 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1496 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1497 MAV_CMD_RUN_PREARM_CHECKS = 401,
1498 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1499 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1500 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1501 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1502 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1503 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1504 MAV_CMD_GET_HOME_POSITION = 410,
1505 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1506 MAV_CMD_INJECT_FAILURE = 420,
1507 #[doc = "Starts receiver pairing."]
1508 MAV_CMD_START_RX_PAIR = 500,
1509 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1510 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1511 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1512 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1513 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1514 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1515 MAV_CMD_REQUEST_MESSAGE = 512,
1516 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1517 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1518 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1519 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1520 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1521 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1522 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1523 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1524 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1525 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1526 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1527 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1528 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1529 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1530 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1531 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1532 MAV_CMD_STORAGE_FORMAT = 526,
1533 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1534 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1535 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1536 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1537 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1538 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1539 #[doc = "Reset all camera settings to Factory Default"]
1540 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1541 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1542 MAV_CMD_SET_CAMERA_MODE = 530,
1543 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1544 MAV_CMD_SET_CAMERA_ZOOM = 531,
1545 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1546 MAV_CMD_SET_CAMERA_FOCUS = 532,
1547 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1548 MAV_CMD_SET_STORAGE_USAGE = 533,
1549 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1550 MAV_CMD_SET_CAMERA_SOURCE = 534,
1551 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1552 MAV_CMD_JUMP_TAG = 600,
1553 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1554 MAV_CMD_DO_JUMP_TAG = 601,
1555 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1556 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1557 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1558 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1559 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1560 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1561 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1562 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1563 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1564 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1565 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1566 #[doc = "Enable or disable on-board camera triggering system."]
1567 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1568 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1569 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1570 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1571 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1572 #[doc = "Stops ongoing tracking."]
1573 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1574 #[doc = "Starts video capture (recording)."]
1575 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1576 #[doc = "Stop the current video capture (recording)."]
1577 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1578 #[doc = "Start video streaming"]
1579 MAV_CMD_VIDEO_START_STREAMING = 2502,
1580 #[doc = "Stop the given video stream"]
1581 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1582 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1583 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1584 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1585 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1586 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1587 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1588 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1589 MAV_CMD_LOGGING_START = 2510,
1590 #[doc = "Request to stop streaming log data over MAVLink"]
1591 MAV_CMD_LOGGING_STOP = 2511,
1592 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1593 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1594 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1595 #[doc = "Create a panorama at the current position"]
1596 MAV_CMD_PANORAMA_CREATE = 2800,
1597 #[doc = "Request VTOL transition"]
1598 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1599 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1600 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1601 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1602 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1603 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1604 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1605 #[doc = "Delay mission state machine until gate has been reached."]
1606 MAV_CMD_CONDITION_GATE = 4501,
1607 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1608 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1609 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1610 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1611 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1612 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1613 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1614 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1615 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1616 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1617 #[doc = "Rally point. You can have multiple rally points defined."]
1618 MAV_CMD_NAV_RALLY_POINT = 5100,
1619 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1620 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1621 #[doc = "Change state of safety switch."]
1622 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1623 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1624 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1625 #[deprecated = " (Deprecated since 2021-06)"]
1626 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1627 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1628 #[deprecated = " (Deprecated since 2021-06)"]
1629 #[doc = "Control the payload deployment."]
1630 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1631 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1632 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1633 #[doc = "Command to operate winch."]
1634 MAV_CMD_DO_WINCH = 42600,
1635 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1636 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1637 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1638 MAV_CMD_WAYPOINT_USER_1 = 31000,
1639 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1640 MAV_CMD_WAYPOINT_USER_2 = 31001,
1641 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1642 MAV_CMD_WAYPOINT_USER_3 = 31002,
1643 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1644 MAV_CMD_WAYPOINT_USER_4 = 31003,
1645 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1646 MAV_CMD_WAYPOINT_USER_5 = 31004,
1647 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1648 MAV_CMD_SPATIAL_USER_1 = 31005,
1649 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1650 MAV_CMD_SPATIAL_USER_2 = 31006,
1651 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1652 MAV_CMD_SPATIAL_USER_3 = 31007,
1653 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1654 MAV_CMD_SPATIAL_USER_4 = 31008,
1655 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1656 MAV_CMD_SPATIAL_USER_5 = 31009,
1657 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1658 MAV_CMD_USER_1 = 31010,
1659 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1660 MAV_CMD_USER_2 = 31011,
1661 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1662 MAV_CMD_USER_3 = 31012,
1663 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1664 MAV_CMD_USER_4 = 31013,
1665 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1666 MAV_CMD_USER_5 = 31014,
1667 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1668 MAV_CMD_CAN_FORWARD = 32000,
1669}
1670impl MavCmd {
1671 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1672}
1673impl Default for MavCmd {
1674 fn default() -> Self {
1675 Self::DEFAULT
1676 }
1677}
1678#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1680#[cfg_attr(feature = "serde", serde(tag = "type"))]
1681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1682#[repr(u32)]
1683#[doc = "Possible actions an aircraft can take to avoid a collision."]
1684pub enum MavCollisionAction {
1685 #[doc = "Ignore any potential collisions"]
1686 MAV_COLLISION_ACTION_NONE = 0,
1687 #[doc = "Report potential collision"]
1688 MAV_COLLISION_ACTION_REPORT = 1,
1689 #[doc = "Ascend or Descend to avoid threat"]
1690 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1691 #[doc = "Move horizontally to avoid threat"]
1692 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1693 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1694 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1695 #[doc = "Aircraft to fly directly back to its launch point"]
1696 MAV_COLLISION_ACTION_RTL = 5,
1697 #[doc = "Aircraft to stop in place"]
1698 MAV_COLLISION_ACTION_HOVER = 6,
1699}
1700impl MavCollisionAction {
1701 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1702}
1703impl Default for MavCollisionAction {
1704 fn default() -> Self {
1705 Self::DEFAULT
1706 }
1707}
1708#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1710#[cfg_attr(feature = "serde", serde(tag = "type"))]
1711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1712#[repr(u32)]
1713#[doc = "Source of information about this collision."]
1714pub enum MavCollisionSrc {
1715 #[doc = "ID field references ADSB_VEHICLE packets"]
1716 MAV_COLLISION_SRC_ADSB = 0,
1717 #[doc = "ID field references MAVLink SRC ID"]
1718 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1719}
1720impl MavCollisionSrc {
1721 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1722}
1723impl Default for MavCollisionSrc {
1724 fn default() -> Self {
1725 Self::DEFAULT
1726 }
1727}
1728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1730#[cfg_attr(feature = "serde", serde(tag = "type"))]
1731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1732#[repr(u32)]
1733#[doc = "Aircraft-rated danger from this threat."]
1734pub enum MavCollisionThreatLevel {
1735 #[doc = "Not a threat"]
1736 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1737 #[doc = "Craft is mildly concerned about this threat"]
1738 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1739 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1740 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1741}
1742impl MavCollisionThreatLevel {
1743 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1744}
1745impl Default for MavCollisionThreatLevel {
1746 fn default() -> Self {
1747 Self::DEFAULT
1748 }
1749}
1750#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1751#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1752#[cfg_attr(feature = "serde", serde(tag = "type"))]
1753#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1754#[repr(u32)]
1755#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1756pub enum MavComponent {
1757 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1758 MAV_COMP_ID_ALL = 0,
1759 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1760 MAV_COMP_ID_AUTOPILOT1 = 1,
1761 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1762 MAV_COMP_ID_USER1 = 25,
1763 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1764 MAV_COMP_ID_USER2 = 26,
1765 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1766 MAV_COMP_ID_USER3 = 27,
1767 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1768 MAV_COMP_ID_USER4 = 28,
1769 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1770 MAV_COMP_ID_USER5 = 29,
1771 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1772 MAV_COMP_ID_USER6 = 30,
1773 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1774 MAV_COMP_ID_USER7 = 31,
1775 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1776 MAV_COMP_ID_USER8 = 32,
1777 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1778 MAV_COMP_ID_USER9 = 33,
1779 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1780 MAV_COMP_ID_USER10 = 34,
1781 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1782 MAV_COMP_ID_USER11 = 35,
1783 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1784 MAV_COMP_ID_USER12 = 36,
1785 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1786 MAV_COMP_ID_USER13 = 37,
1787 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1788 MAV_COMP_ID_USER14 = 38,
1789 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1790 MAV_COMP_ID_USER15 = 39,
1791 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1792 MAV_COMP_ID_USER16 = 40,
1793 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1794 MAV_COMP_ID_USER17 = 41,
1795 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1796 MAV_COMP_ID_USER18 = 42,
1797 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1798 MAV_COMP_ID_USER19 = 43,
1799 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1800 MAV_COMP_ID_USER20 = 44,
1801 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1802 MAV_COMP_ID_USER21 = 45,
1803 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1804 MAV_COMP_ID_USER22 = 46,
1805 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1806 MAV_COMP_ID_USER23 = 47,
1807 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1808 MAV_COMP_ID_USER24 = 48,
1809 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1810 MAV_COMP_ID_USER25 = 49,
1811 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1812 MAV_COMP_ID_USER26 = 50,
1813 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1814 MAV_COMP_ID_USER27 = 51,
1815 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1816 MAV_COMP_ID_USER28 = 52,
1817 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1818 MAV_COMP_ID_USER29 = 53,
1819 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1820 MAV_COMP_ID_USER30 = 54,
1821 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1822 MAV_COMP_ID_USER31 = 55,
1823 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1824 MAV_COMP_ID_USER32 = 56,
1825 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1826 MAV_COMP_ID_USER33 = 57,
1827 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1828 MAV_COMP_ID_USER34 = 58,
1829 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1830 MAV_COMP_ID_USER35 = 59,
1831 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1832 MAV_COMP_ID_USER36 = 60,
1833 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1834 MAV_COMP_ID_USER37 = 61,
1835 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1836 MAV_COMP_ID_USER38 = 62,
1837 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1838 MAV_COMP_ID_USER39 = 63,
1839 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1840 MAV_COMP_ID_USER40 = 64,
1841 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1842 MAV_COMP_ID_USER41 = 65,
1843 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1844 MAV_COMP_ID_USER42 = 66,
1845 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1846 MAV_COMP_ID_USER43 = 67,
1847 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1848 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1849 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1850 MAV_COMP_ID_USER45 = 69,
1851 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1852 MAV_COMP_ID_USER46 = 70,
1853 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1854 MAV_COMP_ID_USER47 = 71,
1855 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1856 MAV_COMP_ID_USER48 = 72,
1857 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1858 MAV_COMP_ID_USER49 = 73,
1859 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1860 MAV_COMP_ID_USER50 = 74,
1861 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1862 MAV_COMP_ID_USER51 = 75,
1863 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1864 MAV_COMP_ID_USER52 = 76,
1865 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1866 MAV_COMP_ID_USER53 = 77,
1867 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1868 MAV_COMP_ID_USER54 = 78,
1869 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1870 MAV_COMP_ID_USER55 = 79,
1871 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1872 MAV_COMP_ID_USER56 = 80,
1873 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1874 MAV_COMP_ID_USER57 = 81,
1875 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1876 MAV_COMP_ID_USER58 = 82,
1877 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1878 MAV_COMP_ID_USER59 = 83,
1879 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1880 MAV_COMP_ID_USER60 = 84,
1881 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1882 MAV_COMP_ID_USER61 = 85,
1883 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1884 MAV_COMP_ID_USER62 = 86,
1885 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1886 MAV_COMP_ID_USER63 = 87,
1887 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1888 MAV_COMP_ID_USER64 = 88,
1889 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1890 MAV_COMP_ID_USER65 = 89,
1891 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1892 MAV_COMP_ID_USER66 = 90,
1893 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1894 MAV_COMP_ID_USER67 = 91,
1895 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1896 MAV_COMP_ID_USER68 = 92,
1897 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1898 MAV_COMP_ID_USER69 = 93,
1899 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1900 MAV_COMP_ID_USER70 = 94,
1901 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1902 MAV_COMP_ID_USER71 = 95,
1903 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1904 MAV_COMP_ID_USER72 = 96,
1905 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1906 MAV_COMP_ID_USER73 = 97,
1907 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1908 MAV_COMP_ID_USER74 = 98,
1909 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1910 MAV_COMP_ID_USER75 = 99,
1911 #[doc = "Camera #1."]
1912 MAV_COMP_ID_CAMERA = 100,
1913 #[doc = "Camera #2."]
1914 MAV_COMP_ID_CAMERA2 = 101,
1915 #[doc = "Camera #3."]
1916 MAV_COMP_ID_CAMERA3 = 102,
1917 #[doc = "Camera #4."]
1918 MAV_COMP_ID_CAMERA4 = 103,
1919 #[doc = "Camera #5."]
1920 MAV_COMP_ID_CAMERA5 = 104,
1921 #[doc = "Camera #6."]
1922 MAV_COMP_ID_CAMERA6 = 105,
1923 #[doc = "Servo #1."]
1924 MAV_COMP_ID_SERVO1 = 140,
1925 #[doc = "Servo #2."]
1926 MAV_COMP_ID_SERVO2 = 141,
1927 #[doc = "Servo #3."]
1928 MAV_COMP_ID_SERVO3 = 142,
1929 #[doc = "Servo #4."]
1930 MAV_COMP_ID_SERVO4 = 143,
1931 #[doc = "Servo #5."]
1932 MAV_COMP_ID_SERVO5 = 144,
1933 #[doc = "Servo #6."]
1934 MAV_COMP_ID_SERVO6 = 145,
1935 #[doc = "Servo #7."]
1936 MAV_COMP_ID_SERVO7 = 146,
1937 #[doc = "Servo #8."]
1938 MAV_COMP_ID_SERVO8 = 147,
1939 #[doc = "Servo #9."]
1940 MAV_COMP_ID_SERVO9 = 148,
1941 #[doc = "Servo #10."]
1942 MAV_COMP_ID_SERVO10 = 149,
1943 #[doc = "Servo #11."]
1944 MAV_COMP_ID_SERVO11 = 150,
1945 #[doc = "Servo #12."]
1946 MAV_COMP_ID_SERVO12 = 151,
1947 #[doc = "Servo #13."]
1948 MAV_COMP_ID_SERVO13 = 152,
1949 #[doc = "Servo #14."]
1950 MAV_COMP_ID_SERVO14 = 153,
1951 #[doc = "Gimbal #1."]
1952 MAV_COMP_ID_GIMBAL = 154,
1953 #[doc = "Logging component."]
1954 MAV_COMP_ID_LOG = 155,
1955 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
1956 MAV_COMP_ID_ADSB = 156,
1957 #[doc = "On Screen Display (OSD) devices for video links."]
1958 MAV_COMP_ID_OSD = 157,
1959 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
1960 MAV_COMP_ID_PERIPHERAL = 158,
1961 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
1962 #[doc = "Gimbal ID for QX1."]
1963 MAV_COMP_ID_QX1_GIMBAL = 159,
1964 #[doc = "FLARM collision alert component."]
1965 MAV_COMP_ID_FLARM = 160,
1966 #[doc = "Parachute component."]
1967 MAV_COMP_ID_PARACHUTE = 161,
1968 #[doc = "Winch component."]
1969 MAV_COMP_ID_WINCH = 169,
1970 #[doc = "Gimbal #2."]
1971 MAV_COMP_ID_GIMBAL2 = 171,
1972 #[doc = "Gimbal #3."]
1973 MAV_COMP_ID_GIMBAL3 = 172,
1974 #[doc = "Gimbal #4"]
1975 MAV_COMP_ID_GIMBAL4 = 173,
1976 #[doc = "Gimbal #5."]
1977 MAV_COMP_ID_GIMBAL5 = 174,
1978 #[doc = "Gimbal #6."]
1979 MAV_COMP_ID_GIMBAL6 = 175,
1980 #[doc = "Battery #1."]
1981 MAV_COMP_ID_BATTERY = 180,
1982 #[doc = "Battery #2."]
1983 MAV_COMP_ID_BATTERY2 = 181,
1984 #[doc = "CAN over MAVLink client."]
1985 MAV_COMP_ID_MAVCAN = 189,
1986 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
1987 MAV_COMP_ID_MISSIONPLANNER = 190,
1988 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1989 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
1990 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1991 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
1992 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1993 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
1994 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1995 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
1996 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
1997 MAV_COMP_ID_PATHPLANNER = 195,
1998 #[doc = "Component that plans a collision free path between two points."]
1999 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2000 #[doc = "Component that provides position estimates using VIO techniques."]
2001 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2002 #[doc = "Component that manages pairing of vehicle and GCS."]
2003 MAV_COMP_ID_PAIRING_MANAGER = 198,
2004 #[doc = "Inertial Measurement Unit (IMU) #1."]
2005 MAV_COMP_ID_IMU = 200,
2006 #[doc = "Inertial Measurement Unit (IMU) #2."]
2007 MAV_COMP_ID_IMU_2 = 201,
2008 #[doc = "Inertial Measurement Unit (IMU) #3."]
2009 MAV_COMP_ID_IMU_3 = 202,
2010 #[doc = "GPS #1."]
2011 MAV_COMP_ID_GPS = 220,
2012 #[doc = "GPS #2."]
2013 MAV_COMP_ID_GPS2 = 221,
2014 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2015 MAV_COMP_ID_ODID_TXRX_1 = 236,
2016 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2017 MAV_COMP_ID_ODID_TXRX_2 = 237,
2018 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2019 MAV_COMP_ID_ODID_TXRX_3 = 238,
2020 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2021 MAV_COMP_ID_UDP_BRIDGE = 240,
2022 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2023 MAV_COMP_ID_UART_BRIDGE = 241,
2024 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2025 MAV_COMP_ID_TUNNEL_NODE = 242,
2026 #[doc = "Illuminator"]
2027 MAV_COMP_ID_ILLUMINATOR = 243,
2028 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2029 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2030 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2031}
2032impl MavComponent {
2033 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2034}
2035impl Default for MavComponent {
2036 fn default() -> Self {
2037 Self::DEFAULT
2038 }
2039}
2040#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2042#[cfg_attr(feature = "serde", serde(tag = "type"))]
2043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2044#[repr(u32)]
2045#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2046#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2047pub enum MavDataStream {
2048 #[doc = "Enable all data streams"]
2049 MAV_DATA_STREAM_ALL = 0,
2050 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2051 MAV_DATA_STREAM_RAW_SENSORS = 1,
2052 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2053 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2054 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2055 MAV_DATA_STREAM_RC_CHANNELS = 3,
2056 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2057 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2058 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2059 MAV_DATA_STREAM_POSITION = 6,
2060 #[doc = "Dependent on the autopilot"]
2061 MAV_DATA_STREAM_EXTRA1 = 10,
2062 #[doc = "Dependent on the autopilot"]
2063 MAV_DATA_STREAM_EXTRA2 = 11,
2064 #[doc = "Dependent on the autopilot"]
2065 MAV_DATA_STREAM_EXTRA3 = 12,
2066}
2067impl MavDataStream {
2068 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2069}
2070impl Default for MavDataStream {
2071 fn default() -> Self {
2072 Self::DEFAULT
2073 }
2074}
2075#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2077#[cfg_attr(feature = "serde", serde(tag = "type"))]
2078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2079#[repr(u32)]
2080#[doc = "Enumeration of distance sensor types"]
2081pub enum MavDistanceSensor {
2082 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2083 MAV_DISTANCE_SENSOR_LASER = 0,
2084 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2085 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2086 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2087 MAV_DISTANCE_SENSOR_INFRARED = 2,
2088 #[doc = "Radar type, e.g. uLanding units"]
2089 MAV_DISTANCE_SENSOR_RADAR = 3,
2090 #[doc = "Broken or unknown type, e.g. analog units"]
2091 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2092}
2093impl MavDistanceSensor {
2094 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2095}
2096impl Default for MavDistanceSensor {
2097 fn default() -> Self {
2098 Self::DEFAULT
2099 }
2100}
2101#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2102#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2103#[cfg_attr(feature = "serde", serde(tag = "type"))]
2104#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2105#[repr(u32)]
2106#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2107pub enum MavDoRepositionFlags {
2108 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2109 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2110}
2111impl MavDoRepositionFlags {
2112 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2113}
2114impl Default for MavDoRepositionFlags {
2115 fn default() -> Self {
2116 Self::DEFAULT
2117 }
2118}
2119#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2121#[cfg_attr(feature = "serde", serde(tag = "type"))]
2122#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2123#[repr(u32)]
2124#[doc = "Enumeration of estimator types"]
2125pub enum MavEstimatorType {
2126 #[doc = "Unknown type of the estimator."]
2127 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2128 #[doc = "This is a naive estimator without any real covariance feedback."]
2129 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2130 #[doc = "Computer vision based estimate. Might be up to scale."]
2131 MAV_ESTIMATOR_TYPE_VISION = 2,
2132 #[doc = "Visual-inertial estimate."]
2133 MAV_ESTIMATOR_TYPE_VIO = 3,
2134 #[doc = "Plain GPS estimate."]
2135 MAV_ESTIMATOR_TYPE_GPS = 4,
2136 #[doc = "Estimator integrating GPS and inertial sensing."]
2137 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2138 #[doc = "Estimate from external motion capturing system."]
2139 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2140 #[doc = "Estimator based on lidar sensor input."]
2141 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2142 #[doc = "Estimator on autopilot."]
2143 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2144}
2145impl MavEstimatorType {
2146 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2147}
2148impl Default for MavEstimatorType {
2149 fn default() -> Self {
2150 Self::DEFAULT
2151 }
2152}
2153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2155#[cfg_attr(feature = "serde", serde(tag = "type"))]
2156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2157#[repr(u32)]
2158#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2159pub enum MavEventCurrentSequenceFlags {
2160 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2161 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2162}
2163impl MavEventCurrentSequenceFlags {
2164 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2165}
2166impl Default for MavEventCurrentSequenceFlags {
2167 fn default() -> Self {
2168 Self::DEFAULT
2169 }
2170}
2171#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2173#[cfg_attr(feature = "serde", serde(tag = "type"))]
2174#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2175#[repr(u32)]
2176#[doc = "Reason for an event error response."]
2177pub enum MavEventErrorReason {
2178 #[doc = "The requested event is not available (anymore)."]
2179 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2180}
2181impl MavEventErrorReason {
2182 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2183}
2184impl Default for MavEventErrorReason {
2185 fn default() -> Self {
2186 Self::DEFAULT
2187 }
2188}
2189#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2191#[cfg_attr(feature = "serde", serde(tag = "type"))]
2192#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2193#[repr(u32)]
2194#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2195pub enum MavFrame {
2196 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2197 MAV_FRAME_GLOBAL = 0,
2198 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2199 MAV_FRAME_LOCAL_NED = 1,
2200 #[doc = "NOT a coordinate frame, indicates a mission command."]
2201 MAV_FRAME_MISSION = 2,
2202 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2203 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2204 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2205 MAV_FRAME_LOCAL_ENU = 4,
2206 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2207 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2208 MAV_FRAME_GLOBAL_INT = 5,
2209 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2210 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2211 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2212 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2213 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2214 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2215 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2216 MAV_FRAME_BODY_NED = 8,
2217 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2218 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2219 MAV_FRAME_BODY_OFFSET_NED = 9,
2220 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2221 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2222 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2223 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2224 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2225 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2226 MAV_FRAME_BODY_FRD = 12,
2227 #[deprecated = " (Deprecated since 2019-04)"]
2228 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2229 MAV_FRAME_RESERVED_13 = 13,
2230 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2231 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2232 MAV_FRAME_RESERVED_14 = 14,
2233 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2234 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2235 MAV_FRAME_RESERVED_15 = 15,
2236 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2237 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2238 MAV_FRAME_RESERVED_16 = 16,
2239 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2240 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2241 MAV_FRAME_RESERVED_17 = 17,
2242 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2243 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2244 MAV_FRAME_RESERVED_18 = 18,
2245 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2246 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2247 MAV_FRAME_RESERVED_19 = 19,
2248 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2249 MAV_FRAME_LOCAL_FRD = 20,
2250 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2251 MAV_FRAME_LOCAL_FLU = 21,
2252}
2253impl MavFrame {
2254 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2255}
2256impl Default for MavFrame {
2257 fn default() -> Self {
2258 Self::DEFAULT
2259 }
2260}
2261#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2263#[cfg_attr(feature = "serde", serde(tag = "type"))]
2264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2265#[repr(u32)]
2266#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2267pub enum MavFtpErr {
2268 #[doc = "None: No error"]
2269 MAV_FTP_ERR_NONE = 0,
2270 #[doc = "Fail: Unknown failure"]
2271 MAV_FTP_ERR_FAIL = 1,
2272 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2273 MAV_FTP_ERR_FAILERRNO = 2,
2274 #[doc = "InvalidDataSize: Payload size is invalid"]
2275 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2276 #[doc = "InvalidSession: Session is not currently open"]
2277 MAV_FTP_ERR_INVALIDSESSION = 4,
2278 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2279 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2280 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2281 MAV_FTP_ERR_EOF = 6,
2282 #[doc = "UnknownCommand: Unknown command / opcode"]
2283 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2284 #[doc = "FileExists: File/directory already exists"]
2285 MAV_FTP_ERR_FILEEXISTS = 8,
2286 #[doc = "FileProtected: File/directory is write protected"]
2287 MAV_FTP_ERR_FILEPROTECTED = 9,
2288 #[doc = "FileNotFound: File/directory not found"]
2289 MAV_FTP_ERR_FILENOTFOUND = 10,
2290}
2291impl MavFtpErr {
2292 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2293}
2294impl Default for MavFtpErr {
2295 fn default() -> Self {
2296 Self::DEFAULT
2297 }
2298}
2299#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2301#[cfg_attr(feature = "serde", serde(tag = "type"))]
2302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2303#[repr(u32)]
2304#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2305pub enum MavFtpOpcode {
2306 #[doc = "None. Ignored, always ACKed"]
2307 MAV_FTP_OPCODE_NONE = 0,
2308 #[doc = "TerminateSession: Terminates open Read session"]
2309 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2310 #[doc = "ResetSessions: Terminates all open read sessions"]
2311 MAV_FTP_OPCODE_RESETSESSION = 2,
2312 #[doc = "ListDirectory. List files and directories in path from offset"]
2313 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2314 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2315 MAV_FTP_OPCODE_OPENFILERO = 4,
2316 #[doc = "ReadFile: Reads size bytes from offset in session"]
2317 MAV_FTP_OPCODE_READFILE = 5,
2318 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2319 MAV_FTP_OPCODE_CREATEFILE = 6,
2320 #[doc = "WriteFile: Writes size bytes to offset in session"]
2321 MAV_FTP_OPCODE_WRITEFILE = 7,
2322 #[doc = "RemoveFile: Remove file at path"]
2323 MAV_FTP_OPCODE_REMOVEFILE = 8,
2324 #[doc = "CreateDirectory: Creates directory at path"]
2325 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2326 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2327 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2328 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2329 MAV_FTP_OPCODE_OPENFILEWO = 11,
2330 #[doc = "TruncateFile: Truncate file at path to offset length"]
2331 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2332 #[doc = "Rename: Rename path1 to path2"]
2333 MAV_FTP_OPCODE_RENAME = 13,
2334 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2335 MAV_FTP_OPCODE_CALCFILECRC = 14,
2336 #[doc = "BurstReadFile: Burst download session file"]
2337 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2338 #[doc = "ACK: ACK response"]
2339 MAV_FTP_OPCODE_ACK = 128,
2340 #[doc = "NAK: NAK response"]
2341 MAV_FTP_OPCODE_NAK = 129,
2342}
2343impl MavFtpOpcode {
2344 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2345}
2346impl Default for MavFtpOpcode {
2347 fn default() -> Self {
2348 Self::DEFAULT
2349 }
2350}
2351#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2353#[cfg_attr(feature = "serde", serde(tag = "type"))]
2354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2355#[repr(u32)]
2356#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2357pub enum MavFuelType {
2358 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2359 MAV_FUEL_TYPE_UNKNOWN = 0,
2360 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2361 MAV_FUEL_TYPE_LIQUID = 1,
2362 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2363 MAV_FUEL_TYPE_GAS = 2,
2364}
2365impl MavFuelType {
2366 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2367}
2368impl Default for MavFuelType {
2369 fn default() -> Self {
2370 Self::DEFAULT
2371 }
2372}
2373bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2374impl MavGeneratorStatusFlag {
2375 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2376}
2377impl Default for MavGeneratorStatusFlag {
2378 fn default() -> Self {
2379 Self::DEFAULT
2380 }
2381}
2382#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2383#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2384#[cfg_attr(feature = "serde", serde(tag = "type"))]
2385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2386#[repr(u32)]
2387#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2388pub enum MavGoto {
2389 #[doc = "Hold at the current position."]
2390 MAV_GOTO_DO_HOLD = 0,
2391 #[doc = "Continue with the next item in mission execution."]
2392 MAV_GOTO_DO_CONTINUE = 1,
2393 #[doc = "Hold at the current position of the system"]
2394 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2395 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2396 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2397}
2398impl MavGoto {
2399 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2400}
2401impl Default for MavGoto {
2402 fn default() -> Self {
2403 Self::DEFAULT
2404 }
2405}
2406#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2408#[cfg_attr(feature = "serde", serde(tag = "type"))]
2409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2410#[repr(u32)]
2411#[doc = "Enumeration of landed detector states"]
2412pub enum MavLandedState {
2413 #[doc = "MAV landed state is unknown"]
2414 MAV_LANDED_STATE_UNDEFINED = 0,
2415 #[doc = "MAV is landed (on ground)"]
2416 MAV_LANDED_STATE_ON_GROUND = 1,
2417 #[doc = "MAV is in air"]
2418 MAV_LANDED_STATE_IN_AIR = 2,
2419 #[doc = "MAV currently taking off"]
2420 MAV_LANDED_STATE_TAKEOFF = 3,
2421 #[doc = "MAV currently landing"]
2422 MAV_LANDED_STATE_LANDING = 4,
2423}
2424impl MavLandedState {
2425 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2426}
2427impl Default for MavLandedState {
2428 fn default() -> Self {
2429 Self::DEFAULT
2430 }
2431}
2432#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2434#[cfg_attr(feature = "serde", serde(tag = "type"))]
2435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2436#[repr(u32)]
2437#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2438pub enum MavMissionResult {
2439 #[doc = "mission accepted OK"]
2440 MAV_MISSION_ACCEPTED = 0,
2441 #[doc = "Generic error / not accepting mission commands at all right now."]
2442 MAV_MISSION_ERROR = 1,
2443 #[doc = "Coordinate frame is not supported."]
2444 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2445 #[doc = "Command is not supported."]
2446 MAV_MISSION_UNSUPPORTED = 3,
2447 #[doc = "Mission items exceed storage space."]
2448 MAV_MISSION_NO_SPACE = 4,
2449 #[doc = "One of the parameters has an invalid value."]
2450 MAV_MISSION_INVALID = 5,
2451 #[doc = "param1 has an invalid value."]
2452 MAV_MISSION_INVALID_PARAM1 = 6,
2453 #[doc = "param2 has an invalid value."]
2454 MAV_MISSION_INVALID_PARAM2 = 7,
2455 #[doc = "param3 has an invalid value."]
2456 MAV_MISSION_INVALID_PARAM3 = 8,
2457 #[doc = "param4 has an invalid value."]
2458 MAV_MISSION_INVALID_PARAM4 = 9,
2459 #[doc = "x / param5 has an invalid value."]
2460 MAV_MISSION_INVALID_PARAM5_X = 10,
2461 #[doc = "y / param6 has an invalid value."]
2462 MAV_MISSION_INVALID_PARAM6_Y = 11,
2463 #[doc = "z / param7 has an invalid value."]
2464 MAV_MISSION_INVALID_PARAM7 = 12,
2465 #[doc = "Mission item received out of sequence"]
2466 MAV_MISSION_INVALID_SEQUENCE = 13,
2467 #[doc = "Not accepting any mission commands from this communication partner."]
2468 MAV_MISSION_DENIED = 14,
2469 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2470 MAV_MISSION_OPERATION_CANCELLED = 15,
2471}
2472impl MavMissionResult {
2473 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2474}
2475impl Default for MavMissionResult {
2476 fn default() -> Self {
2477 Self::DEFAULT
2478 }
2479}
2480#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2482#[cfg_attr(feature = "serde", serde(tag = "type"))]
2483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2484#[repr(u32)]
2485#[doc = "Type of mission items being requested/sent in mission protocol."]
2486pub enum MavMissionType {
2487 #[doc = "Items are mission commands for main mission."]
2488 MAV_MISSION_TYPE_MISSION = 0,
2489 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2490 MAV_MISSION_TYPE_FENCE = 1,
2491 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2492 MAV_MISSION_TYPE_RALLY = 2,
2493 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2494 MAV_MISSION_TYPE_ALL = 255,
2495}
2496impl MavMissionType {
2497 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2498}
2499impl Default for MavMissionType {
2500 fn default() -> Self {
2501 Self::DEFAULT
2502 }
2503}
2504#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2506#[cfg_attr(feature = "serde", serde(tag = "type"))]
2507#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2508#[repr(u32)]
2509#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2510pub enum MavMode {
2511 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2512 MAV_MODE_PREFLIGHT = 0,
2513 #[doc = "System is allowed to be active, under assisted RC control."]
2514 MAV_MODE_STABILIZE_DISARMED = 80,
2515 #[doc = "System is allowed to be active, under assisted RC control."]
2516 MAV_MODE_STABILIZE_ARMED = 208,
2517 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2518 MAV_MODE_MANUAL_DISARMED = 64,
2519 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2520 MAV_MODE_MANUAL_ARMED = 192,
2521 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2522 MAV_MODE_GUIDED_DISARMED = 88,
2523 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2524 MAV_MODE_GUIDED_ARMED = 216,
2525 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2526 MAV_MODE_AUTO_DISARMED = 92,
2527 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2528 MAV_MODE_AUTO_ARMED = 220,
2529 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2530 MAV_MODE_TEST_DISARMED = 66,
2531 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2532 MAV_MODE_TEST_ARMED = 194,
2533}
2534impl MavMode {
2535 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2536}
2537impl Default for MavMode {
2538 fn default() -> Self {
2539 Self::DEFAULT
2540 }
2541}
2542bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2543impl MavModeFlag {
2544 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2545}
2546impl Default for MavModeFlag {
2547 fn default() -> Self {
2548 Self::DEFAULT
2549 }
2550}
2551#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2552#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2553#[cfg_attr(feature = "serde", serde(tag = "type"))]
2554#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2555#[repr(u32)]
2556#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2557pub enum MavModeFlagDecodePosition {
2558 #[doc = "First bit: 10000000"]
2559 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2560 #[doc = "Second bit: 01000000"]
2561 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2562 #[doc = "Third bit: 00100000"]
2563 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2564 #[doc = "Fourth bit: 00010000"]
2565 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2566 #[doc = "Fifth bit: 00001000"]
2567 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2568 #[doc = "Sixth bit: 00000100"]
2569 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2570 #[doc = "Seventh bit: 00000010"]
2571 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2572 #[doc = "Eighth bit: 00000001"]
2573 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2574}
2575impl MavModeFlagDecodePosition {
2576 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2577}
2578impl Default for MavModeFlagDecodePosition {
2579 fn default() -> Self {
2580 Self::DEFAULT
2581 }
2582}
2583bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2584impl MavModeProperty {
2585 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2586}
2587impl Default for MavModeProperty {
2588 fn default() -> Self {
2589 Self::DEFAULT
2590 }
2591}
2592#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2593#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2594#[cfg_attr(feature = "serde", serde(tag = "type"))]
2595#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2596#[repr(u32)]
2597#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2598#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2599pub enum MavMountMode {
2600 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2601 MAV_MOUNT_MODE_RETRACT = 0,
2602 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2603 MAV_MOUNT_MODE_NEUTRAL = 1,
2604 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2605 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2606 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2607 MAV_MOUNT_MODE_RC_TARGETING = 3,
2608 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2609 MAV_MOUNT_MODE_GPS_POINT = 4,
2610 #[doc = "Gimbal tracks system with specified system ID"]
2611 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2612 #[doc = "Gimbal tracks home position"]
2613 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2614}
2615impl MavMountMode {
2616 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2617}
2618impl Default for MavMountMode {
2619 fn default() -> Self {
2620 Self::DEFAULT
2621 }
2622}
2623#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2625#[cfg_attr(feature = "serde", serde(tag = "type"))]
2626#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2627#[repr(u32)]
2628pub enum MavOdidArmStatus {
2629 #[doc = "Passing arming checks."]
2630 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2631 #[doc = "Generic arming failure, see error string for details."]
2632 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2633}
2634impl MavOdidArmStatus {
2635 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2636}
2637impl Default for MavOdidArmStatus {
2638 fn default() -> Self {
2639 Self::DEFAULT
2640 }
2641}
2642#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2643#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2644#[cfg_attr(feature = "serde", serde(tag = "type"))]
2645#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2646#[repr(u32)]
2647pub enum MavOdidAuthType {
2648 #[doc = "No authentication type is specified."]
2649 MAV_ODID_AUTH_TYPE_NONE = 0,
2650 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2651 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2652 #[doc = "Signature for the Operator ID."]
2653 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2654 #[doc = "Signature for the entire message set."]
2655 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2656 #[doc = "Authentication is provided by Network Remote ID."]
2657 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2658 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2659 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2660}
2661impl MavOdidAuthType {
2662 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2663}
2664impl Default for MavOdidAuthType {
2665 fn default() -> Self {
2666 Self::DEFAULT
2667 }
2668}
2669#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2671#[cfg_attr(feature = "serde", serde(tag = "type"))]
2672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2673#[repr(u32)]
2674pub enum MavOdidCategoryEu {
2675 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2676 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2677 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2678 MAV_ODID_CATEGORY_EU_OPEN = 1,
2679 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2680 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2681 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2682 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2683}
2684impl MavOdidCategoryEu {
2685 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2686}
2687impl Default for MavOdidCategoryEu {
2688 fn default() -> Self {
2689 Self::DEFAULT
2690 }
2691}
2692#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2694#[cfg_attr(feature = "serde", serde(tag = "type"))]
2695#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2696#[repr(u32)]
2697pub enum MavOdidClassEu {
2698 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2699 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2700 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2701 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2702 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2703 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2704 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2705 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2706 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2707 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2708 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2709 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2710 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2711 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2712 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2713 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2714}
2715impl MavOdidClassEu {
2716 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2717}
2718impl Default for MavOdidClassEu {
2719 fn default() -> Self {
2720 Self::DEFAULT
2721 }
2722}
2723#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2724#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2725#[cfg_attr(feature = "serde", serde(tag = "type"))]
2726#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2727#[repr(u32)]
2728pub enum MavOdidClassificationType {
2729 #[doc = "The classification type for the UA is undeclared."]
2730 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2731 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2732 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2733}
2734impl MavOdidClassificationType {
2735 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2736}
2737impl Default for MavOdidClassificationType {
2738 fn default() -> Self {
2739 Self::DEFAULT
2740 }
2741}
2742#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2743#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2744#[cfg_attr(feature = "serde", serde(tag = "type"))]
2745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2746#[repr(u32)]
2747pub enum MavOdidDescType {
2748 #[doc = "Optional free-form text description of the purpose of the flight."]
2749 MAV_ODID_DESC_TYPE_TEXT = 0,
2750 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2751 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2752 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2753 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2754}
2755impl MavOdidDescType {
2756 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2757}
2758impl Default for MavOdidDescType {
2759 fn default() -> Self {
2760 Self::DEFAULT
2761 }
2762}
2763#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2765#[cfg_attr(feature = "serde", serde(tag = "type"))]
2766#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2767#[repr(u32)]
2768pub enum MavOdidHeightRef {
2769 #[doc = "The height field is relative to the take-off location."]
2770 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2771 #[doc = "The height field is relative to ground."]
2772 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2773}
2774impl MavOdidHeightRef {
2775 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2776}
2777impl Default for MavOdidHeightRef {
2778 fn default() -> Self {
2779 Self::DEFAULT
2780 }
2781}
2782#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2784#[cfg_attr(feature = "serde", serde(tag = "type"))]
2785#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2786#[repr(u32)]
2787pub enum MavOdidHorAcc {
2788 #[doc = "The horizontal accuracy is unknown."]
2789 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2790 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2791 MAV_ODID_HOR_ACC_10NM = 1,
2792 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2793 MAV_ODID_HOR_ACC_4NM = 2,
2794 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2795 MAV_ODID_HOR_ACC_2NM = 3,
2796 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2797 MAV_ODID_HOR_ACC_1NM = 4,
2798 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2799 MAV_ODID_HOR_ACC_0_5NM = 5,
2800 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2801 MAV_ODID_HOR_ACC_0_3NM = 6,
2802 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2803 MAV_ODID_HOR_ACC_0_1NM = 7,
2804 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2805 MAV_ODID_HOR_ACC_0_05NM = 8,
2806 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2807 MAV_ODID_HOR_ACC_30_METER = 9,
2808 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2809 MAV_ODID_HOR_ACC_10_METER = 10,
2810 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2811 MAV_ODID_HOR_ACC_3_METER = 11,
2812 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2813 MAV_ODID_HOR_ACC_1_METER = 12,
2814}
2815impl MavOdidHorAcc {
2816 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2817}
2818impl Default for MavOdidHorAcc {
2819 fn default() -> Self {
2820 Self::DEFAULT
2821 }
2822}
2823#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2825#[cfg_attr(feature = "serde", serde(tag = "type"))]
2826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2827#[repr(u32)]
2828pub enum MavOdidIdType {
2829 #[doc = "No type defined."]
2830 MAV_ODID_ID_TYPE_NONE = 0,
2831 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2832 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2833 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2834 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2835 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2836 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2837 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2838 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2839}
2840impl MavOdidIdType {
2841 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2842}
2843impl Default for MavOdidIdType {
2844 fn default() -> Self {
2845 Self::DEFAULT
2846 }
2847}
2848#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2849#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2850#[cfg_attr(feature = "serde", serde(tag = "type"))]
2851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2852#[repr(u32)]
2853pub enum MavOdidOperatorIdType {
2854 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2855 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2856}
2857impl MavOdidOperatorIdType {
2858 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2859}
2860impl Default for MavOdidOperatorIdType {
2861 fn default() -> Self {
2862 Self::DEFAULT
2863 }
2864}
2865#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2867#[cfg_attr(feature = "serde", serde(tag = "type"))]
2868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2869#[repr(u32)]
2870pub enum MavOdidOperatorLocationType {
2871 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2872 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2873 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2874 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2875 #[doc = "The location/altitude of the operator are fixed values."]
2876 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2877}
2878impl MavOdidOperatorLocationType {
2879 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2880}
2881impl Default for MavOdidOperatorLocationType {
2882 fn default() -> Self {
2883 Self::DEFAULT
2884 }
2885}
2886#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2887#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2888#[cfg_attr(feature = "serde", serde(tag = "type"))]
2889#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2890#[repr(u32)]
2891pub enum MavOdidSpeedAcc {
2892 #[doc = "The speed accuracy is unknown."]
2893 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2894 #[doc = "The speed accuracy is smaller than 10 meters per second."]
2895 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
2896 #[doc = "The speed accuracy is smaller than 3 meters per second."]
2897 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
2898 #[doc = "The speed accuracy is smaller than 1 meters per second."]
2899 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
2900 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
2901 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
2902}
2903impl MavOdidSpeedAcc {
2904 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
2905}
2906impl Default for MavOdidSpeedAcc {
2907 fn default() -> Self {
2908 Self::DEFAULT
2909 }
2910}
2911#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2913#[cfg_attr(feature = "serde", serde(tag = "type"))]
2914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2915#[repr(u32)]
2916pub enum MavOdidStatus {
2917 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
2918 MAV_ODID_STATUS_UNDECLARED = 0,
2919 #[doc = "The UA is on the ground."]
2920 MAV_ODID_STATUS_GROUND = 1,
2921 #[doc = "The UA is in the air."]
2922 MAV_ODID_STATUS_AIRBORNE = 2,
2923 #[doc = "The UA is having an emergency."]
2924 MAV_ODID_STATUS_EMERGENCY = 3,
2925 #[doc = "The remote ID system is failing or unreliable in some way."]
2926 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
2927}
2928impl MavOdidStatus {
2929 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
2930}
2931impl Default for MavOdidStatus {
2932 fn default() -> Self {
2933 Self::DEFAULT
2934 }
2935}
2936#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2938#[cfg_attr(feature = "serde", serde(tag = "type"))]
2939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2940#[repr(u32)]
2941pub enum MavOdidTimeAcc {
2942 #[doc = "The timestamp accuracy is unknown."]
2943 MAV_ODID_TIME_ACC_UNKNOWN = 0,
2944 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
2945 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
2946 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
2947 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
2948 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
2949 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
2950 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
2951 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
2952 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
2953 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
2954 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
2955 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
2956 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
2957 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
2958 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
2959 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
2960 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
2961 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
2962 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
2963 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
2964 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
2965 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
2966 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
2967 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
2968 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
2969 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
2970 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
2971 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
2972 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
2973 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
2974}
2975impl MavOdidTimeAcc {
2976 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
2977}
2978impl Default for MavOdidTimeAcc {
2979 fn default() -> Self {
2980 Self::DEFAULT
2981 }
2982}
2983#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2985#[cfg_attr(feature = "serde", serde(tag = "type"))]
2986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2987#[repr(u32)]
2988pub enum MavOdidUaType {
2989 #[doc = "No UA (Unmanned Aircraft) type defined."]
2990 MAV_ODID_UA_TYPE_NONE = 0,
2991 #[doc = "Aeroplane/Airplane. Fixed wing."]
2992 MAV_ODID_UA_TYPE_AEROPLANE = 1,
2993 #[doc = "Helicopter or multirotor."]
2994 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
2995 #[doc = "Gyroplane."]
2996 MAV_ODID_UA_TYPE_GYROPLANE = 3,
2997 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
2998 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
2999 #[doc = "Ornithopter."]
3000 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3001 #[doc = "Glider."]
3002 MAV_ODID_UA_TYPE_GLIDER = 6,
3003 #[doc = "Kite."]
3004 MAV_ODID_UA_TYPE_KITE = 7,
3005 #[doc = "Free Balloon."]
3006 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3007 #[doc = "Captive Balloon."]
3008 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3009 #[doc = "Airship. E.g. a blimp."]
3010 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3011 #[doc = "Free Fall/Parachute (unpowered)."]
3012 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3013 #[doc = "Rocket."]
3014 MAV_ODID_UA_TYPE_ROCKET = 12,
3015 #[doc = "Tethered powered aircraft."]
3016 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3017 #[doc = "Ground Obstacle."]
3018 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3019 #[doc = "Other type of aircraft not listed earlier."]
3020 MAV_ODID_UA_TYPE_OTHER = 15,
3021}
3022impl MavOdidUaType {
3023 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3024}
3025impl Default for MavOdidUaType {
3026 fn default() -> Self {
3027 Self::DEFAULT
3028 }
3029}
3030#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3031#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3032#[cfg_attr(feature = "serde", serde(tag = "type"))]
3033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3034#[repr(u32)]
3035pub enum MavOdidVerAcc {
3036 #[doc = "The vertical accuracy is unknown."]
3037 MAV_ODID_VER_ACC_UNKNOWN = 0,
3038 #[doc = "The vertical accuracy is smaller than 150 meter."]
3039 MAV_ODID_VER_ACC_150_METER = 1,
3040 #[doc = "The vertical accuracy is smaller than 45 meter."]
3041 MAV_ODID_VER_ACC_45_METER = 2,
3042 #[doc = "The vertical accuracy is smaller than 25 meter."]
3043 MAV_ODID_VER_ACC_25_METER = 3,
3044 #[doc = "The vertical accuracy is smaller than 10 meter."]
3045 MAV_ODID_VER_ACC_10_METER = 4,
3046 #[doc = "The vertical accuracy is smaller than 3 meter."]
3047 MAV_ODID_VER_ACC_3_METER = 5,
3048 #[doc = "The vertical accuracy is smaller than 1 meter."]
3049 MAV_ODID_VER_ACC_1_METER = 6,
3050}
3051impl MavOdidVerAcc {
3052 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3053}
3054impl Default for MavOdidVerAcc {
3055 fn default() -> Self {
3056 Self::DEFAULT
3057 }
3058}
3059#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3060#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3061#[cfg_attr(feature = "serde", serde(tag = "type"))]
3062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3063#[repr(u32)]
3064#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3065pub enum MavParamExtType {
3066 #[doc = "8-bit unsigned integer"]
3067 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3068 #[doc = "8-bit signed integer"]
3069 MAV_PARAM_EXT_TYPE_INT8 = 2,
3070 #[doc = "16-bit unsigned integer"]
3071 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3072 #[doc = "16-bit signed integer"]
3073 MAV_PARAM_EXT_TYPE_INT16 = 4,
3074 #[doc = "32-bit unsigned integer"]
3075 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3076 #[doc = "32-bit signed integer"]
3077 MAV_PARAM_EXT_TYPE_INT32 = 6,
3078 #[doc = "64-bit unsigned integer"]
3079 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3080 #[doc = "64-bit signed integer"]
3081 MAV_PARAM_EXT_TYPE_INT64 = 8,
3082 #[doc = "32-bit floating-point"]
3083 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3084 #[doc = "64-bit floating-point"]
3085 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3086 #[doc = "Custom Type"]
3087 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3088}
3089impl MavParamExtType {
3090 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3091}
3092impl Default for MavParamExtType {
3093 fn default() -> Self {
3094 Self::DEFAULT
3095 }
3096}
3097#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3099#[cfg_attr(feature = "serde", serde(tag = "type"))]
3100#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3101#[repr(u32)]
3102#[doc = "Specifies the datatype of a MAVLink parameter."]
3103pub enum MavParamType {
3104 #[doc = "8-bit unsigned integer"]
3105 MAV_PARAM_TYPE_UINT8 = 1,
3106 #[doc = "8-bit signed integer"]
3107 MAV_PARAM_TYPE_INT8 = 2,
3108 #[doc = "16-bit unsigned integer"]
3109 MAV_PARAM_TYPE_UINT16 = 3,
3110 #[doc = "16-bit signed integer"]
3111 MAV_PARAM_TYPE_INT16 = 4,
3112 #[doc = "32-bit unsigned integer"]
3113 MAV_PARAM_TYPE_UINT32 = 5,
3114 #[doc = "32-bit signed integer"]
3115 MAV_PARAM_TYPE_INT32 = 6,
3116 #[doc = "64-bit unsigned integer"]
3117 MAV_PARAM_TYPE_UINT64 = 7,
3118 #[doc = "64-bit signed integer"]
3119 MAV_PARAM_TYPE_INT64 = 8,
3120 #[doc = "32-bit floating-point"]
3121 MAV_PARAM_TYPE_REAL32 = 9,
3122 #[doc = "64-bit floating-point"]
3123 MAV_PARAM_TYPE_REAL64 = 10,
3124}
3125impl MavParamType {
3126 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3127}
3128impl Default for MavParamType {
3129 fn default() -> Self {
3130 Self::DEFAULT
3131 }
3132}
3133bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3134impl MavPowerStatus {
3135 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3136}
3137impl Default for MavPowerStatus {
3138 fn default() -> Self {
3139 Self::DEFAULT
3140 }
3141}
3142bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3143impl MavProtocolCapability {
3144 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3145}
3146impl Default for MavProtocolCapability {
3147 fn default() -> Self {
3148 Self::DEFAULT
3149 }
3150}
3151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3153#[cfg_attr(feature = "serde", serde(tag = "type"))]
3154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3155#[repr(u32)]
3156#[doc = "Result from a MAVLink command (MAV_CMD)"]
3157pub enum MavResult {
3158 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3159 MAV_RESULT_ACCEPTED = 0,
3160 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3161 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3162 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3163 MAV_RESULT_DENIED = 2,
3164 #[doc = "Command is not supported (unknown)."]
3165 MAV_RESULT_UNSUPPORTED = 3,
3166 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3167 MAV_RESULT_FAILED = 4,
3168 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3169 MAV_RESULT_IN_PROGRESS = 5,
3170 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3171 MAV_RESULT_CANCELLED = 6,
3172 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3173 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3174 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3175 MAV_RESULT_COMMAND_INT_ONLY = 8,
3176 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3177 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3178}
3179impl MavResult {
3180 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3181}
3182impl Default for MavResult {
3183 fn default() -> Self {
3184 Self::DEFAULT
3185 }
3186}
3187#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3188#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3189#[cfg_attr(feature = "serde", serde(tag = "type"))]
3190#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3191#[repr(u32)]
3192#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3193#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3194pub enum MavRoi {
3195 #[doc = "No region of interest."]
3196 MAV_ROI_NONE = 0,
3197 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3198 MAV_ROI_WPNEXT = 1,
3199 #[doc = "Point toward given waypoint."]
3200 MAV_ROI_WPINDEX = 2,
3201 #[doc = "Point toward fixed location."]
3202 MAV_ROI_LOCATION = 3,
3203 #[doc = "Point toward of given id."]
3204 MAV_ROI_TARGET = 4,
3205}
3206impl MavRoi {
3207 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3208}
3209impl Default for MavRoi {
3210 fn default() -> Self {
3211 Self::DEFAULT
3212 }
3213}
3214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3216#[cfg_attr(feature = "serde", serde(tag = "type"))]
3217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3218#[repr(u32)]
3219#[doc = "Enumeration of sensor orientation, according to its rotations"]
3220pub enum MavSensorOrientation {
3221 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3222 MAV_SENSOR_ROTATION_NONE = 0,
3223 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3224 MAV_SENSOR_ROTATION_YAW_45 = 1,
3225 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3226 MAV_SENSOR_ROTATION_YAW_90 = 2,
3227 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3228 MAV_SENSOR_ROTATION_YAW_135 = 3,
3229 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3230 MAV_SENSOR_ROTATION_YAW_180 = 4,
3231 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3232 MAV_SENSOR_ROTATION_YAW_225 = 5,
3233 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3234 MAV_SENSOR_ROTATION_YAW_270 = 6,
3235 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3236 MAV_SENSOR_ROTATION_YAW_315 = 7,
3237 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3238 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3239 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3240 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3241 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3242 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3243 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3244 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3245 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3246 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3247 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3248 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3249 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3250 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3251 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3252 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3253 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3254 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3255 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3256 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3257 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3258 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3259 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3260 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3261 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3262 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3263 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3264 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3265 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3266 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3267 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3268 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3269 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3270 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3271 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3272 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3273 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3274 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3275 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3276 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3277 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3278 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3279 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3280 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3281 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3282 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3283 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3284 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3285 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3286 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3287 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3288 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3289 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3290 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3291 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3292 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3293 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3294 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3295 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3296 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3297 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3298 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3299 #[doc = "Pitch: 315"]
3300 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3301 #[doc = "Roll: 90, Pitch: 315"]
3302 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3303 #[doc = "Custom orientation"]
3304 MAV_SENSOR_ROTATION_CUSTOM = 100,
3305}
3306impl MavSensorOrientation {
3307 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3308}
3309impl Default for MavSensorOrientation {
3310 fn default() -> Self {
3311 Self::DEFAULT
3312 }
3313}
3314#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3316#[cfg_attr(feature = "serde", serde(tag = "type"))]
3317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3318#[repr(u32)]
3319#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3320pub enum MavSeverity {
3321 #[doc = "System is unusable. This is a \"panic\" condition."]
3322 MAV_SEVERITY_EMERGENCY = 0,
3323 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3324 MAV_SEVERITY_ALERT = 1,
3325 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3326 MAV_SEVERITY_CRITICAL = 2,
3327 #[doc = "Indicates an error in secondary/redundant systems."]
3328 MAV_SEVERITY_ERROR = 3,
3329 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3330 MAV_SEVERITY_WARNING = 4,
3331 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3332 MAV_SEVERITY_NOTICE = 5,
3333 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3334 MAV_SEVERITY_INFO = 6,
3335 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3336 MAV_SEVERITY_DEBUG = 7,
3337}
3338impl MavSeverity {
3339 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3340}
3341impl Default for MavSeverity {
3342 fn default() -> Self {
3343 Self::DEFAULT
3344 }
3345}
3346#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3348#[cfg_attr(feature = "serde", serde(tag = "type"))]
3349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3350#[repr(u32)]
3351#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3352pub enum MavStandardMode {
3353 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3354 MAV_STANDARD_MODE_NON_STANDARD = 0,
3355 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3356 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3357 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3358 MAV_STANDARD_MODE_ORBIT = 2,
3359 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3360 MAV_STANDARD_MODE_CRUISE = 3,
3361 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3362 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3363 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3364 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3365 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3366 MAV_STANDARD_MODE_MISSION = 6,
3367 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3368 MAV_STANDARD_MODE_LAND = 7,
3369 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3370 MAV_STANDARD_MODE_TAKEOFF = 8,
3371}
3372impl MavStandardMode {
3373 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3374}
3375impl Default for MavStandardMode {
3376 fn default() -> Self {
3377 Self::DEFAULT
3378 }
3379}
3380#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3381#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3382#[cfg_attr(feature = "serde", serde(tag = "type"))]
3383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3384#[repr(u32)]
3385pub enum MavState {
3386 #[doc = "Uninitialized system, state is unknown."]
3387 MAV_STATE_UNINIT = 0,
3388 #[doc = "System is booting up."]
3389 MAV_STATE_BOOT = 1,
3390 #[doc = "System is calibrating and not flight-ready."]
3391 MAV_STATE_CALIBRATING = 2,
3392 #[doc = "System is grounded and on standby. It can be launched any time."]
3393 MAV_STATE_STANDBY = 3,
3394 #[doc = "System is active and might be already airborne. Motors are engaged."]
3395 MAV_STATE_ACTIVE = 4,
3396 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3397 MAV_STATE_CRITICAL = 5,
3398 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3399 MAV_STATE_EMERGENCY = 6,
3400 #[doc = "System just initialized its power-down sequence, will shut down now."]
3401 MAV_STATE_POWEROFF = 7,
3402 #[doc = "System is terminating itself (failsafe or commanded)."]
3403 MAV_STATE_FLIGHT_TERMINATION = 8,
3404}
3405impl MavState {
3406 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3407}
3408impl Default for MavState {
3409 fn default() -> Self {
3410 Self::DEFAULT
3411 }
3412}
3413bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3414impl MavSysStatusSensor {
3415 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3416}
3417impl Default for MavSysStatusSensor {
3418 fn default() -> Self {
3419 Self::DEFAULT
3420 }
3421}
3422bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3423impl MavSysStatusSensorExtended {
3424 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3425}
3426impl Default for MavSysStatusSensorExtended {
3427 fn default() -> Self {
3428 Self::DEFAULT
3429 }
3430}
3431#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3432#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3433#[cfg_attr(feature = "serde", serde(tag = "type"))]
3434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3435#[repr(u32)]
3436pub enum MavTunnelPayloadType {
3437 #[doc = "Encoding of payload unknown."]
3438 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3439 #[doc = "Registered for STorM32 gimbal controller."]
3440 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3441 #[doc = "Registered for STorM32 gimbal controller."]
3442 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3443 #[doc = "Registered for STorM32 gimbal controller."]
3444 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3445 #[doc = "Registered for STorM32 gimbal controller."]
3446 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3447 #[doc = "Registered for STorM32 gimbal controller."]
3448 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3449 #[doc = "Registered for STorM32 gimbal controller."]
3450 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3451 #[doc = "Registered for STorM32 gimbal controller."]
3452 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3453 #[doc = "Registered for STorM32 gimbal controller."]
3454 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3455 #[doc = "Registered for STorM32 gimbal controller."]
3456 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3457 #[doc = "Registered for STorM32 gimbal controller."]
3458 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3459 #[doc = "Registered for ModalAI remote OSD protocol."]
3460 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3461 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3462 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3463 #[doc = "Registered for ModalAI vendor use."]
3464 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3465}
3466impl MavTunnelPayloadType {
3467 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3468}
3469impl Default for MavTunnelPayloadType {
3470 fn default() -> Self {
3471 Self::DEFAULT
3472 }
3473}
3474#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3476#[cfg_attr(feature = "serde", serde(tag = "type"))]
3477#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3478#[repr(u32)]
3479#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3480pub enum MavType {
3481 #[doc = "Generic micro air vehicle"]
3482 MAV_TYPE_GENERIC = 0,
3483 #[doc = "Fixed wing aircraft."]
3484 MAV_TYPE_FIXED_WING = 1,
3485 #[doc = "Quadrotor"]
3486 MAV_TYPE_QUADROTOR = 2,
3487 #[doc = "Coaxial helicopter"]
3488 MAV_TYPE_COAXIAL = 3,
3489 #[doc = "Normal helicopter with tail rotor."]
3490 MAV_TYPE_HELICOPTER = 4,
3491 #[doc = "Ground installation"]
3492 MAV_TYPE_ANTENNA_TRACKER = 5,
3493 #[doc = "Operator control unit / ground control station"]
3494 MAV_TYPE_GCS = 6,
3495 #[doc = "Airship, controlled"]
3496 MAV_TYPE_AIRSHIP = 7,
3497 #[doc = "Free balloon, uncontrolled"]
3498 MAV_TYPE_FREE_BALLOON = 8,
3499 #[doc = "Rocket"]
3500 MAV_TYPE_ROCKET = 9,
3501 #[doc = "Ground rover"]
3502 MAV_TYPE_GROUND_ROVER = 10,
3503 #[doc = "Surface vessel, boat, ship"]
3504 MAV_TYPE_SURFACE_BOAT = 11,
3505 #[doc = "Submarine"]
3506 MAV_TYPE_SUBMARINE = 12,
3507 #[doc = "Hexarotor"]
3508 MAV_TYPE_HEXAROTOR = 13,
3509 #[doc = "Octorotor"]
3510 MAV_TYPE_OCTOROTOR = 14,
3511 #[doc = "Tricopter"]
3512 MAV_TYPE_TRICOPTER = 15,
3513 #[doc = "Flapping wing"]
3514 MAV_TYPE_FLAPPING_WING = 16,
3515 #[doc = "Kite"]
3516 MAV_TYPE_KITE = 17,
3517 #[doc = "Onboard companion controller"]
3518 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3519 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3520 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3521 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3522 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3523 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3524 MAV_TYPE_VTOL_TILTROTOR = 21,
3525 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3526 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3527 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3528 MAV_TYPE_VTOL_TAILSITTER = 23,
3529 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3530 MAV_TYPE_VTOL_TILTWING = 24,
3531 #[doc = "VTOL reserved 5"]
3532 MAV_TYPE_VTOL_RESERVED5 = 25,
3533 #[doc = "Gimbal"]
3534 MAV_TYPE_GIMBAL = 26,
3535 #[doc = "ADSB system"]
3536 MAV_TYPE_ADSB = 27,
3537 #[doc = "Steerable, nonrigid airfoil"]
3538 MAV_TYPE_PARAFOIL = 28,
3539 #[doc = "Dodecarotor"]
3540 MAV_TYPE_DODECAROTOR = 29,
3541 #[doc = "Camera"]
3542 MAV_TYPE_CAMERA = 30,
3543 #[doc = "Charging station"]
3544 MAV_TYPE_CHARGING_STATION = 31,
3545 #[doc = "FLARM collision avoidance system"]
3546 MAV_TYPE_FLARM = 32,
3547 #[doc = "Servo"]
3548 MAV_TYPE_SERVO = 33,
3549 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3550 MAV_TYPE_ODID = 34,
3551 #[doc = "Decarotor"]
3552 MAV_TYPE_DECAROTOR = 35,
3553 #[doc = "Battery"]
3554 MAV_TYPE_BATTERY = 36,
3555 #[doc = "Parachute"]
3556 MAV_TYPE_PARACHUTE = 37,
3557 #[doc = "Log"]
3558 MAV_TYPE_LOG = 38,
3559 #[doc = "OSD"]
3560 MAV_TYPE_OSD = 39,
3561 #[doc = "IMU"]
3562 MAV_TYPE_IMU = 40,
3563 #[doc = "GPS"]
3564 MAV_TYPE_GPS = 41,
3565 #[doc = "Winch"]
3566 MAV_TYPE_WINCH = 42,
3567 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3568 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3569 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3570 MAV_TYPE_ILLUMINATOR = 44,
3571 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3572 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3573}
3574impl MavType {
3575 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3576}
3577impl Default for MavType {
3578 fn default() -> Self {
3579 Self::DEFAULT
3580 }
3581}
3582#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3583#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3584#[cfg_attr(feature = "serde", serde(tag = "type"))]
3585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3586#[repr(u32)]
3587#[doc = "Enumeration of VTOL states"]
3588pub enum MavVtolState {
3589 #[doc = "MAV is not configured as VTOL"]
3590 MAV_VTOL_STATE_UNDEFINED = 0,
3591 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3592 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3593 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3594 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3595 #[doc = "VTOL is in multicopter state"]
3596 MAV_VTOL_STATE_MC = 3,
3597 #[doc = "VTOL is in fixed-wing state"]
3598 MAV_VTOL_STATE_FW = 4,
3599}
3600impl MavVtolState {
3601 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3602}
3603impl Default for MavVtolState {
3604 fn default() -> Self {
3605 Self::DEFAULT
3606 }
3607}
3608bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3609impl MavWinchStatusFlag {
3610 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3611}
3612impl Default for MavWinchStatusFlag {
3613 fn default() -> Self {
3614 Self::DEFAULT
3615 }
3616}
3617#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3618#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3619#[cfg_attr(feature = "serde", serde(tag = "type"))]
3620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3621#[repr(u32)]
3622pub enum MavlinkDataStreamType {
3623 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3624 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3625 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3626 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3627 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3628 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3629}
3630impl MavlinkDataStreamType {
3631 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3632}
3633impl Default for MavlinkDataStreamType {
3634 fn default() -> Self {
3635 Self::DEFAULT
3636 }
3637}
3638#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3639#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3640#[cfg_attr(feature = "serde", serde(tag = "type"))]
3641#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3642#[repr(u32)]
3643#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3644pub enum MissionState {
3645 #[doc = "The mission status reporting is not supported."]
3646 MISSION_STATE_UNKNOWN = 0,
3647 #[doc = "No mission on the vehicle."]
3648 MISSION_STATE_NO_MISSION = 1,
3649 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3650 MISSION_STATE_NOT_STARTED = 2,
3651 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3652 MISSION_STATE_ACTIVE = 3,
3653 #[doc = "Mission is paused when in auto mode."]
3654 MISSION_STATE_PAUSED = 4,
3655 #[doc = "Mission has executed all mission items."]
3656 MISSION_STATE_COMPLETE = 5,
3657}
3658impl MissionState {
3659 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3660}
3661impl Default for MissionState {
3662 fn default() -> Self {
3663 Self::DEFAULT
3664 }
3665}
3666#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3667#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3668#[cfg_attr(feature = "serde", serde(tag = "type"))]
3669#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3670#[repr(u32)]
3671#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3672pub enum MotorTestOrder {
3673 #[doc = "Default autopilot motor test method."]
3674 MOTOR_TEST_ORDER_DEFAULT = 0,
3675 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3676 MOTOR_TEST_ORDER_SEQUENCE = 1,
3677 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3678 MOTOR_TEST_ORDER_BOARD = 2,
3679}
3680impl MotorTestOrder {
3681 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3682}
3683impl Default for MotorTestOrder {
3684 fn default() -> Self {
3685 Self::DEFAULT
3686 }
3687}
3688#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3690#[cfg_attr(feature = "serde", serde(tag = "type"))]
3691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3692#[repr(u32)]
3693#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3694pub enum MotorTestThrottleType {
3695 #[doc = "Throttle as a percentage (0 ~ 100)"]
3696 MOTOR_TEST_THROTTLE_PERCENT = 0,
3697 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3698 MOTOR_TEST_THROTTLE_PWM = 1,
3699 #[doc = "Throttle pass-through from pilot's transmitter."]
3700 MOTOR_TEST_THROTTLE_PILOT = 2,
3701 #[doc = "Per-motor compass calibration test."]
3702 MOTOR_TEST_COMPASS_CAL = 3,
3703}
3704impl MotorTestThrottleType {
3705 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3706}
3707impl Default for MotorTestThrottleType {
3708 fn default() -> Self {
3709 Self::DEFAULT
3710 }
3711}
3712#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3713#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3714#[cfg_attr(feature = "serde", serde(tag = "type"))]
3715#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3716#[repr(u32)]
3717pub enum NavVtolLandOptions {
3718 #[doc = "Default autopilot landing behaviour."]
3719 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3720 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3721 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3722 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3723 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3724}
3725impl NavVtolLandOptions {
3726 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3727}
3728impl Default for NavVtolLandOptions {
3729 fn default() -> Self {
3730 Self::DEFAULT
3731 }
3732}
3733#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3735#[cfg_attr(feature = "serde", serde(tag = "type"))]
3736#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3737#[repr(u32)]
3738#[doc = "Yaw behaviour during orbit flight."]
3739pub enum OrbitYawBehaviour {
3740 #[doc = "Vehicle front points to the center (default)."]
3741 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3742 #[doc = "Vehicle front holds heading when message received."]
3743 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3744 #[doc = "Yaw uncontrolled."]
3745 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3746 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3747 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3748 #[doc = "Yaw controlled by RC input."]
3749 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3750 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3751 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3752}
3753impl OrbitYawBehaviour {
3754 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3755}
3756impl Default for OrbitYawBehaviour {
3757 fn default() -> Self {
3758 Self::DEFAULT
3759 }
3760}
3761#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3763#[cfg_attr(feature = "serde", serde(tag = "type"))]
3764#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3765#[repr(u32)]
3766#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3767pub enum ParachuteAction {
3768 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3769 PARACHUTE_DISABLE = 0,
3770 #[doc = "Enable auto-release of parachute."]
3771 PARACHUTE_ENABLE = 1,
3772 #[doc = "Release parachute and kill motors."]
3773 PARACHUTE_RELEASE = 2,
3774}
3775impl ParachuteAction {
3776 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3777}
3778impl Default for ParachuteAction {
3779 fn default() -> Self {
3780 Self::DEFAULT
3781 }
3782}
3783#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3785#[cfg_attr(feature = "serde", serde(tag = "type"))]
3786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3787#[repr(u32)]
3788#[doc = "Result from PARAM_EXT_SET message."]
3789pub enum ParamAck {
3790 #[doc = "Parameter value ACCEPTED and SET"]
3791 PARAM_ACK_ACCEPTED = 0,
3792 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3793 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3794 #[doc = "Parameter failed to set"]
3795 PARAM_ACK_FAILED = 2,
3796 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3797 PARAM_ACK_IN_PROGRESS = 3,
3798}
3799impl ParamAck {
3800 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3801}
3802impl Default for ParamAck {
3803 fn default() -> Self {
3804 Self::DEFAULT
3805 }
3806}
3807bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3808impl PositionTargetTypemask {
3809 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3810}
3811impl Default for PositionTargetTypemask {
3812 fn default() -> Self {
3813 Self::DEFAULT
3814 }
3815}
3816#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3818#[cfg_attr(feature = "serde", serde(tag = "type"))]
3819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3820#[repr(u32)]
3821#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3822pub enum PrecisionLandMode {
3823 #[doc = "Normal (non-precision) landing."]
3824 PRECISION_LAND_MODE_DISABLED = 0,
3825 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3826 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3827 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3828 PRECISION_LAND_MODE_REQUIRED = 2,
3829}
3830impl PrecisionLandMode {
3831 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3832}
3833impl Default for PrecisionLandMode {
3834 fn default() -> Self {
3835 Self::DEFAULT
3836 }
3837}
3838#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3840#[cfg_attr(feature = "serde", serde(tag = "type"))]
3841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3842#[repr(u32)]
3843#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3844pub enum PreflightStorageMissionAction {
3845 #[doc = "Read current mission data from persistent storage"]
3846 MISSION_READ_PERSISTENT = 0,
3847 #[doc = "Write current mission data to persistent storage"]
3848 MISSION_WRITE_PERSISTENT = 1,
3849 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3850 MISSION_RESET_DEFAULT = 2,
3851}
3852impl PreflightStorageMissionAction {
3853 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3854}
3855impl Default for PreflightStorageMissionAction {
3856 fn default() -> Self {
3857 Self::DEFAULT
3858 }
3859}
3860#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3861#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3862#[cfg_attr(feature = "serde", serde(tag = "type"))]
3863#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3864#[repr(u32)]
3865#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3866pub enum PreflightStorageParameterAction {
3867 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3868 PARAM_READ_PERSISTENT = 0,
3869 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3870 PARAM_WRITE_PERSISTENT = 1,
3871 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3872 PARAM_RESET_CONFIG_DEFAULT = 2,
3873 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3874 PARAM_RESET_SENSOR_DEFAULT = 3,
3875 #[doc = "Reset all parameters, including operation counters, to default values"]
3876 PARAM_RESET_ALL_DEFAULT = 4,
3877}
3878impl PreflightStorageParameterAction {
3879 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3880}
3881impl Default for PreflightStorageParameterAction {
3882 fn default() -> Self {
3883 Self::DEFAULT
3884 }
3885}
3886#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3887#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3888#[cfg_attr(feature = "serde", serde(tag = "type"))]
3889#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3890#[repr(u32)]
3891#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3892pub enum RcSubType {
3893 #[doc = "Spektrum DSM2"]
3894 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
3895 #[doc = "Spektrum DSMX"]
3896 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
3897 #[doc = "Spektrum DSMX8"]
3898 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
3899}
3900impl RcSubType {
3901 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
3902}
3903impl Default for RcSubType {
3904 fn default() -> Self {
3905 Self::DEFAULT
3906 }
3907}
3908#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3909#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3910#[cfg_attr(feature = "serde", serde(tag = "type"))]
3911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3912#[repr(u32)]
3913#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
3914pub enum RcType {
3915 #[doc = "Spektrum"]
3916 RC_TYPE_SPEKTRUM = 0,
3917 #[doc = "CRSF"]
3918 RC_TYPE_CRSF = 1,
3919}
3920impl RcType {
3921 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
3922}
3923impl Default for RcType {
3924 fn default() -> Self {
3925 Self::DEFAULT
3926 }
3927}
3928#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3930#[cfg_attr(feature = "serde", serde(tag = "type"))]
3931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3932#[repr(u32)]
3933#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
3934pub enum RebootShutdownConditions {
3935 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
3936 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
3937 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
3938 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
3939}
3940impl RebootShutdownConditions {
3941 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
3942}
3943impl Default for RebootShutdownConditions {
3944 fn default() -> Self {
3945 Self::DEFAULT
3946 }
3947}
3948#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3950#[cfg_attr(feature = "serde", serde(tag = "type"))]
3951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3952#[repr(u32)]
3953#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
3954pub enum RtkBaselineCoordinateSystem {
3955 #[doc = "Earth-centered, Earth-fixed"]
3956 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
3957 #[doc = "RTK basestation centered, north, east, down"]
3958 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
3959}
3960impl RtkBaselineCoordinateSystem {
3961 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
3962}
3963impl Default for RtkBaselineCoordinateSystem {
3964 fn default() -> Self {
3965 Self::DEFAULT
3966 }
3967}
3968#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3970#[cfg_attr(feature = "serde", serde(tag = "type"))]
3971#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3972#[repr(u32)]
3973#[doc = "Possible safety switch states."]
3974pub enum SafetySwitchState {
3975 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
3976 SAFETY_SWITCH_STATE_SAFE = 0,
3977 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
3978 SAFETY_SWITCH_STATE_DANGEROUS = 1,
3979}
3980impl SafetySwitchState {
3981 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
3982}
3983impl Default for SafetySwitchState {
3984 fn default() -> Self {
3985 Self::DEFAULT
3986 }
3987}
3988#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3989#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3990#[cfg_attr(feature = "serde", serde(tag = "type"))]
3991#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3992#[repr(u32)]
3993#[doc = "SERIAL_CONTROL device types"]
3994pub enum SerialControlDev {
3995 #[doc = "First telemetry port"]
3996 SERIAL_CONTROL_DEV_TELEM1 = 0,
3997 #[doc = "Second telemetry port"]
3998 SERIAL_CONTROL_DEV_TELEM2 = 1,
3999 #[doc = "First GPS port"]
4000 SERIAL_CONTROL_DEV_GPS1 = 2,
4001 #[doc = "Second GPS port"]
4002 SERIAL_CONTROL_DEV_GPS2 = 3,
4003 #[doc = "system shell"]
4004 SERIAL_CONTROL_DEV_SHELL = 10,
4005 #[doc = "SERIAL0"]
4006 SERIAL_CONTROL_SERIAL0 = 100,
4007 #[doc = "SERIAL1"]
4008 SERIAL_CONTROL_SERIAL1 = 101,
4009 #[doc = "SERIAL2"]
4010 SERIAL_CONTROL_SERIAL2 = 102,
4011 #[doc = "SERIAL3"]
4012 SERIAL_CONTROL_SERIAL3 = 103,
4013 #[doc = "SERIAL4"]
4014 SERIAL_CONTROL_SERIAL4 = 104,
4015 #[doc = "SERIAL5"]
4016 SERIAL_CONTROL_SERIAL5 = 105,
4017 #[doc = "SERIAL6"]
4018 SERIAL_CONTROL_SERIAL6 = 106,
4019 #[doc = "SERIAL7"]
4020 SERIAL_CONTROL_SERIAL7 = 107,
4021 #[doc = "SERIAL8"]
4022 SERIAL_CONTROL_SERIAL8 = 108,
4023 #[doc = "SERIAL9"]
4024 SERIAL_CONTROL_SERIAL9 = 109,
4025}
4026impl SerialControlDev {
4027 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4028}
4029impl Default for SerialControlDev {
4030 fn default() -> Self {
4031 Self::DEFAULT
4032 }
4033}
4034bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4035impl SerialControlFlag {
4036 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4037}
4038impl Default for SerialControlFlag {
4039 fn default() -> Self {
4040 Self::DEFAULT
4041 }
4042}
4043#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4044#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4045#[cfg_attr(feature = "serde", serde(tag = "type"))]
4046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4047#[repr(u32)]
4048#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4049pub enum SetFocusType {
4050 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4051 FOCUS_TYPE_STEP = 0,
4052 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4053 FOCUS_TYPE_CONTINUOUS = 1,
4054 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4055 FOCUS_TYPE_RANGE = 2,
4056 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4057 FOCUS_TYPE_METERS = 3,
4058 #[doc = "Focus automatically."]
4059 FOCUS_TYPE_AUTO = 4,
4060 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4061 FOCUS_TYPE_AUTO_SINGLE = 5,
4062 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4063 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4064}
4065impl SetFocusType {
4066 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4067}
4068impl Default for SetFocusType {
4069 fn default() -> Self {
4070 Self::DEFAULT
4071 }
4072}
4073#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4075#[cfg_attr(feature = "serde", serde(tag = "type"))]
4076#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4077#[repr(u32)]
4078#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4079pub enum SpeedType {
4080 #[doc = "Airspeed"]
4081 SPEED_TYPE_AIRSPEED = 0,
4082 #[doc = "Groundspeed"]
4083 SPEED_TYPE_GROUNDSPEED = 1,
4084 #[doc = "Climb speed"]
4085 SPEED_TYPE_CLIMB_SPEED = 2,
4086 #[doc = "Descent speed"]
4087 SPEED_TYPE_DESCENT_SPEED = 3,
4088}
4089impl SpeedType {
4090 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4091}
4092impl Default for SpeedType {
4093 fn default() -> Self {
4094 Self::DEFAULT
4095 }
4096}
4097#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4099#[cfg_attr(feature = "serde", serde(tag = "type"))]
4100#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4101#[repr(u32)]
4102#[doc = "Flags to indicate the status of camera storage."]
4103pub enum StorageStatus {
4104 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4105 STORAGE_STATUS_EMPTY = 0,
4106 #[doc = "Storage present but unformatted."]
4107 STORAGE_STATUS_UNFORMATTED = 1,
4108 #[doc = "Storage present and ready."]
4109 STORAGE_STATUS_READY = 2,
4110 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4111 STORAGE_STATUS_NOT_SUPPORTED = 3,
4112}
4113impl StorageStatus {
4114 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4115}
4116impl Default for StorageStatus {
4117 fn default() -> Self {
4118 Self::DEFAULT
4119 }
4120}
4121#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4123#[cfg_attr(feature = "serde", serde(tag = "type"))]
4124#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4125#[repr(u32)]
4126#[doc = "Flags to indicate the type of storage."]
4127pub enum StorageType {
4128 #[doc = "Storage type is not known."]
4129 STORAGE_TYPE_UNKNOWN = 0,
4130 #[doc = "Storage type is USB device."]
4131 STORAGE_TYPE_USB_STICK = 1,
4132 #[doc = "Storage type is SD card."]
4133 STORAGE_TYPE_SD = 2,
4134 #[doc = "Storage type is microSD card."]
4135 STORAGE_TYPE_MICROSD = 3,
4136 #[doc = "Storage type is CFast."]
4137 STORAGE_TYPE_CF = 4,
4138 #[doc = "Storage type is CFexpress."]
4139 STORAGE_TYPE_CFE = 5,
4140 #[doc = "Storage type is XQD."]
4141 STORAGE_TYPE_XQD = 6,
4142 #[doc = "Storage type is HD mass storage type."]
4143 STORAGE_TYPE_HD = 7,
4144 #[doc = "Storage type is other, not listed type."]
4145 STORAGE_TYPE_OTHER = 254,
4146}
4147impl StorageType {
4148 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4149}
4150impl Default for StorageType {
4151 fn default() -> Self {
4152 Self::DEFAULT
4153 }
4154}
4155bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4156impl StorageUsageFlag {
4157 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4158}
4159impl Default for StorageUsageFlag {
4160 fn default() -> Self {
4161 Self::DEFAULT
4162 }
4163}
4164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4166#[cfg_attr(feature = "serde", serde(tag = "type"))]
4167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4168#[repr(u32)]
4169#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4170pub enum TuneFormat {
4171 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4172 TUNE_FORMAT_QBASIC1_1 = 1,
4173 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4174 TUNE_FORMAT_MML_MODERN = 2,
4175}
4176impl TuneFormat {
4177 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4178}
4179impl Default for TuneFormat {
4180 fn default() -> Self {
4181 Self::DEFAULT
4182 }
4183}
4184#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4185#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4186#[cfg_attr(feature = "serde", serde(tag = "type"))]
4187#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4188#[repr(u32)]
4189#[doc = "Generalized UAVCAN node health"]
4190pub enum UavcanNodeHealth {
4191 #[doc = "The node is functioning properly."]
4192 UAVCAN_NODE_HEALTH_OK = 0,
4193 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4194 UAVCAN_NODE_HEALTH_WARNING = 1,
4195 #[doc = "The node has encountered a major failure."]
4196 UAVCAN_NODE_HEALTH_ERROR = 2,
4197 #[doc = "The node has suffered a fatal malfunction."]
4198 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4199}
4200impl UavcanNodeHealth {
4201 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4202}
4203impl Default for UavcanNodeHealth {
4204 fn default() -> Self {
4205 Self::DEFAULT
4206 }
4207}
4208#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4210#[cfg_attr(feature = "serde", serde(tag = "type"))]
4211#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4212#[repr(u32)]
4213#[doc = "Generalized UAVCAN node mode"]
4214pub enum UavcanNodeMode {
4215 #[doc = "The node is performing its primary functions."]
4216 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4217 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4218 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4219 #[doc = "The node is under maintenance."]
4220 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4221 #[doc = "The node is in the process of updating its software."]
4222 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4223 #[doc = "The node is no longer available online."]
4224 UAVCAN_NODE_MODE_OFFLINE = 7,
4225}
4226impl UavcanNodeMode {
4227 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4228}
4229impl Default for UavcanNodeMode {
4230 fn default() -> Self {
4231 Self::DEFAULT
4232 }
4233}
4234bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4235impl UtmDataAvailFlags {
4236 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4237}
4238impl Default for UtmDataAvailFlags {
4239 fn default() -> Self {
4240 Self::DEFAULT
4241 }
4242}
4243#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4244#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4245#[cfg_attr(feature = "serde", serde(tag = "type"))]
4246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4247#[repr(u32)]
4248#[doc = "Airborne status of UAS."]
4249pub enum UtmFlightState {
4250 #[doc = "The flight state can't be determined."]
4251 UTM_FLIGHT_STATE_UNKNOWN = 1,
4252 #[doc = "UAS on ground."]
4253 UTM_FLIGHT_STATE_GROUND = 2,
4254 #[doc = "UAS airborne."]
4255 UTM_FLIGHT_STATE_AIRBORNE = 3,
4256 #[doc = "UAS is in an emergency flight state."]
4257 UTM_FLIGHT_STATE_EMERGENCY = 16,
4258 #[doc = "UAS has no active controls."]
4259 UTM_FLIGHT_STATE_NOCTRL = 32,
4260}
4261impl UtmFlightState {
4262 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4263}
4264impl Default for UtmFlightState {
4265 fn default() -> Self {
4266 Self::DEFAULT
4267 }
4268}
4269#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4271#[cfg_attr(feature = "serde", serde(tag = "type"))]
4272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4273#[repr(u32)]
4274#[doc = "Video stream encodings"]
4275pub enum VideoStreamEncoding {
4276 #[doc = "Stream encoding is unknown"]
4277 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4278 #[doc = "Stream encoding is H.264"]
4279 VIDEO_STREAM_ENCODING_H264 = 1,
4280 #[doc = "Stream encoding is H.265"]
4281 VIDEO_STREAM_ENCODING_H265 = 2,
4282}
4283impl VideoStreamEncoding {
4284 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4285}
4286impl Default for VideoStreamEncoding {
4287 fn default() -> Self {
4288 Self::DEFAULT
4289 }
4290}
4291bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4292impl VideoStreamStatusFlags {
4293 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4294}
4295impl Default for VideoStreamStatusFlags {
4296 fn default() -> Self {
4297 Self::DEFAULT
4298 }
4299}
4300#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4302#[cfg_attr(feature = "serde", serde(tag = "type"))]
4303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4304#[repr(u32)]
4305#[doc = "Video stream types"]
4306pub enum VideoStreamType {
4307 #[doc = "Stream is RTSP"]
4308 VIDEO_STREAM_TYPE_RTSP = 0,
4309 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4310 VIDEO_STREAM_TYPE_RTPUDP = 1,
4311 #[doc = "Stream is MPEG on TCP"]
4312 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4313 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4314 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4315}
4316impl VideoStreamType {
4317 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4318}
4319impl Default for VideoStreamType {
4320 fn default() -> Self {
4321 Self::DEFAULT
4322 }
4323}
4324#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4325#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4326#[cfg_attr(feature = "serde", serde(tag = "type"))]
4327#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4328#[repr(u32)]
4329#[doc = "Direction of VTOL transition"]
4330pub enum VtolTransitionHeading {
4331 #[doc = "Respect the heading configuration of the vehicle."]
4332 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4333 #[doc = "Use the heading pointing towards the next waypoint."]
4334 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4335 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4336 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4337 #[doc = "Use the specified heading in parameter 4."]
4338 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4339 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4340 VTOL_TRANSITION_HEADING_ANY = 4,
4341}
4342impl VtolTransitionHeading {
4343 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4344}
4345impl Default for VtolTransitionHeading {
4346 fn default() -> Self {
4347 Self::DEFAULT
4348 }
4349}
4350#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4351#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4352#[cfg_attr(feature = "serde", serde(tag = "type"))]
4353#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4354#[repr(u32)]
4355#[doc = "WiFi Mode."]
4356pub enum WifiConfigApMode {
4357 #[doc = "WiFi mode is undefined."]
4358 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4359 #[doc = "WiFi configured as an access point."]
4360 WIFI_CONFIG_AP_MODE_AP = 1,
4361 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4362 WIFI_CONFIG_AP_MODE_STATION = 2,
4363 #[doc = "WiFi disabled."]
4364 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4365}
4366impl WifiConfigApMode {
4367 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4368}
4369impl Default for WifiConfigApMode {
4370 fn default() -> Self {
4371 Self::DEFAULT
4372 }
4373}
4374#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4376#[cfg_attr(feature = "serde", serde(tag = "type"))]
4377#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4378#[repr(u32)]
4379#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4380pub enum WifiConfigApResponse {
4381 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4382 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4383 #[doc = "Changes accepted."]
4384 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4385 #[doc = "Changes rejected."]
4386 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4387 #[doc = "Invalid Mode."]
4388 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4389 #[doc = "Invalid SSID."]
4390 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4391 #[doc = "Invalid Password."]
4392 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4393}
4394impl WifiConfigApResponse {
4395 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4396}
4397impl Default for WifiConfigApResponse {
4398 fn default() -> Self {
4399 Self::DEFAULT
4400 }
4401}
4402#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4404#[cfg_attr(feature = "serde", serde(tag = "type"))]
4405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4406#[repr(u32)]
4407#[doc = "Winch actions."]
4408pub enum WinchActions {
4409 #[doc = "Allow motor to freewheel."]
4410 WINCH_RELAXED = 0,
4411 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4412 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4413 #[doc = "Wind or unwind line at specified rate."]
4414 WINCH_RATE_CONTROL = 2,
4415 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4416 WINCH_LOCK = 3,
4417 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4418 WINCH_DELIVER = 4,
4419 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4420 WINCH_HOLD = 5,
4421 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4422 WINCH_RETRACT = 6,
4423 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4424 WINCH_LOAD_LINE = 7,
4425 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4426 WINCH_ABANDON_LINE = 8,
4427 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4428 WINCH_LOAD_PAYLOAD = 9,
4429}
4430impl WinchActions {
4431 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4432}
4433impl Default for WinchActions {
4434 fn default() -> Self {
4435 Self::DEFAULT
4436 }
4437}
4438#[doc = "id: 140"]
4439#[doc = "Set the vehicle attitude and body angular rates."]
4440#[derive(Debug, Clone, PartialEq)]
4441#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4442#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4443pub struct ACTUATOR_CONTROL_TARGET_DATA {
4444 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4445 pub time_usec: u64,
4446 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4447 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4448 pub controls: [f32; 8],
4449 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4450 pub group_mlx: u8,
4451}
4452impl ACTUATOR_CONTROL_TARGET_DATA {
4453 pub const ENCODED_LEN: usize = 41usize;
4454 pub const DEFAULT: Self = Self {
4455 time_usec: 0_u64,
4456 controls: [0.0_f32; 8usize],
4457 group_mlx: 0_u8,
4458 };
4459 #[cfg(feature = "arbitrary")]
4460 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4461 use arbitrary::{Arbitrary, Unstructured};
4462 let mut buf = [0u8; 1024];
4463 rng.fill_bytes(&mut buf);
4464 let mut unstructured = Unstructured::new(&buf);
4465 Self::arbitrary(&mut unstructured).unwrap_or_default()
4466 }
4467}
4468impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4469 fn default() -> Self {
4470 Self::DEFAULT.clone()
4471 }
4472}
4473impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4474 type Message = MavMessage;
4475 const ID: u32 = 140u32;
4476 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4477 const EXTRA_CRC: u8 = 181u8;
4478 const ENCODED_LEN: usize = 41usize;
4479 fn deser(
4480 _version: MavlinkVersion,
4481 __input: &[u8],
4482 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4483 let avail_len = __input.len();
4484 let mut payload_buf = [0; Self::ENCODED_LEN];
4485 let mut buf = if avail_len < Self::ENCODED_LEN {
4486 payload_buf[0..avail_len].copy_from_slice(__input);
4487 Bytes::new(&payload_buf)
4488 } else {
4489 Bytes::new(__input)
4490 };
4491 let mut __struct = Self::default();
4492 __struct.time_usec = buf.get_u64_le();
4493 for v in &mut __struct.controls {
4494 let val = buf.get_f32_le();
4495 *v = val;
4496 }
4497 __struct.group_mlx = buf.get_u8();
4498 Ok(__struct)
4499 }
4500 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4501 let mut __tmp = BytesMut::new(bytes);
4502 #[allow(clippy::absurd_extreme_comparisons)]
4503 #[allow(unused_comparisons)]
4504 if __tmp.remaining() < Self::ENCODED_LEN {
4505 panic!(
4506 "buffer is too small (need {} bytes, but got {})",
4507 Self::ENCODED_LEN,
4508 __tmp.remaining(),
4509 )
4510 }
4511 __tmp.put_u64_le(self.time_usec);
4512 for val in &self.controls {
4513 __tmp.put_f32_le(*val);
4514 }
4515 __tmp.put_u8(self.group_mlx);
4516 if matches!(version, MavlinkVersion::V2) {
4517 let len = __tmp.len();
4518 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4519 } else {
4520 __tmp.len()
4521 }
4522 }
4523}
4524#[doc = "id: 375"]
4525#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4526#[derive(Debug, Clone, PartialEq)]
4527#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4528#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4529pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4530 #[doc = "Timestamp (since system boot)."]
4531 pub time_usec: u64,
4532 #[doc = "Active outputs"]
4533 pub active: u32,
4534 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4535 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4536 pub actuator: [f32; 32],
4537}
4538impl ACTUATOR_OUTPUT_STATUS_DATA {
4539 pub const ENCODED_LEN: usize = 140usize;
4540 pub const DEFAULT: Self = Self {
4541 time_usec: 0_u64,
4542 active: 0_u32,
4543 actuator: [0.0_f32; 32usize],
4544 };
4545 #[cfg(feature = "arbitrary")]
4546 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4547 use arbitrary::{Arbitrary, Unstructured};
4548 let mut buf = [0u8; 1024];
4549 rng.fill_bytes(&mut buf);
4550 let mut unstructured = Unstructured::new(&buf);
4551 Self::arbitrary(&mut unstructured).unwrap_or_default()
4552 }
4553}
4554impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4555 fn default() -> Self {
4556 Self::DEFAULT.clone()
4557 }
4558}
4559impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4560 type Message = MavMessage;
4561 const ID: u32 = 375u32;
4562 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4563 const EXTRA_CRC: u8 = 251u8;
4564 const ENCODED_LEN: usize = 140usize;
4565 fn deser(
4566 _version: MavlinkVersion,
4567 __input: &[u8],
4568 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4569 let avail_len = __input.len();
4570 let mut payload_buf = [0; Self::ENCODED_LEN];
4571 let mut buf = if avail_len < Self::ENCODED_LEN {
4572 payload_buf[0..avail_len].copy_from_slice(__input);
4573 Bytes::new(&payload_buf)
4574 } else {
4575 Bytes::new(__input)
4576 };
4577 let mut __struct = Self::default();
4578 __struct.time_usec = buf.get_u64_le();
4579 __struct.active = buf.get_u32_le();
4580 for v in &mut __struct.actuator {
4581 let val = buf.get_f32_le();
4582 *v = val;
4583 }
4584 Ok(__struct)
4585 }
4586 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4587 let mut __tmp = BytesMut::new(bytes);
4588 #[allow(clippy::absurd_extreme_comparisons)]
4589 #[allow(unused_comparisons)]
4590 if __tmp.remaining() < Self::ENCODED_LEN {
4591 panic!(
4592 "buffer is too small (need {} bytes, but got {})",
4593 Self::ENCODED_LEN,
4594 __tmp.remaining(),
4595 )
4596 }
4597 __tmp.put_u64_le(self.time_usec);
4598 __tmp.put_u32_le(self.active);
4599 for val in &self.actuator {
4600 __tmp.put_f32_le(*val);
4601 }
4602 if matches!(version, MavlinkVersion::V2) {
4603 let len = __tmp.len();
4604 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4605 } else {
4606 __tmp.len()
4607 }
4608 }
4609}
4610#[doc = "id: 246"]
4611#[doc = "The location and information of an ADSB vehicle."]
4612#[derive(Debug, Clone, PartialEq)]
4613#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4614#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4615pub struct ADSB_VEHICLE_DATA {
4616 #[doc = "ICAO address"]
4617 pub ICAO_address: u32,
4618 #[doc = "Latitude"]
4619 pub lat: i32,
4620 #[doc = "Longitude"]
4621 pub lon: i32,
4622 #[doc = "Altitude(ASL)"]
4623 pub altitude: i32,
4624 #[doc = "Course over ground"]
4625 pub heading: u16,
4626 #[doc = "The horizontal velocity"]
4627 pub hor_velocity: u16,
4628 #[doc = "The vertical velocity. Positive is up"]
4629 pub ver_velocity: i16,
4630 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4631 pub flags: AdsbFlags,
4632 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4633 pub squawk: u16,
4634 #[doc = "ADSB altitude type."]
4635 pub altitude_type: AdsbAltitudeType,
4636 #[doc = "The callsign, 8+null"]
4637 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4638 pub callsign: [u8; 9],
4639 #[doc = "ADSB emitter type."]
4640 pub emitter_type: AdsbEmitterType,
4641 #[doc = "Time since last communication in seconds"]
4642 pub tslc: u8,
4643}
4644impl ADSB_VEHICLE_DATA {
4645 pub const ENCODED_LEN: usize = 38usize;
4646 pub const DEFAULT: Self = Self {
4647 ICAO_address: 0_u32,
4648 lat: 0_i32,
4649 lon: 0_i32,
4650 altitude: 0_i32,
4651 heading: 0_u16,
4652 hor_velocity: 0_u16,
4653 ver_velocity: 0_i16,
4654 flags: AdsbFlags::DEFAULT,
4655 squawk: 0_u16,
4656 altitude_type: AdsbAltitudeType::DEFAULT,
4657 callsign: [0_u8; 9usize],
4658 emitter_type: AdsbEmitterType::DEFAULT,
4659 tslc: 0_u8,
4660 };
4661 #[cfg(feature = "arbitrary")]
4662 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4663 use arbitrary::{Arbitrary, Unstructured};
4664 let mut buf = [0u8; 1024];
4665 rng.fill_bytes(&mut buf);
4666 let mut unstructured = Unstructured::new(&buf);
4667 Self::arbitrary(&mut unstructured).unwrap_or_default()
4668 }
4669}
4670impl Default for ADSB_VEHICLE_DATA {
4671 fn default() -> Self {
4672 Self::DEFAULT.clone()
4673 }
4674}
4675impl MessageData for ADSB_VEHICLE_DATA {
4676 type Message = MavMessage;
4677 const ID: u32 = 246u32;
4678 const NAME: &'static str = "ADSB_VEHICLE";
4679 const EXTRA_CRC: u8 = 184u8;
4680 const ENCODED_LEN: usize = 38usize;
4681 fn deser(
4682 _version: MavlinkVersion,
4683 __input: &[u8],
4684 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4685 let avail_len = __input.len();
4686 let mut payload_buf = [0; Self::ENCODED_LEN];
4687 let mut buf = if avail_len < Self::ENCODED_LEN {
4688 payload_buf[0..avail_len].copy_from_slice(__input);
4689 Bytes::new(&payload_buf)
4690 } else {
4691 Bytes::new(__input)
4692 };
4693 let mut __struct = Self::default();
4694 __struct.ICAO_address = buf.get_u32_le();
4695 __struct.lat = buf.get_i32_le();
4696 __struct.lon = buf.get_i32_le();
4697 __struct.altitude = buf.get_i32_le();
4698 __struct.heading = buf.get_u16_le();
4699 __struct.hor_velocity = buf.get_u16_le();
4700 __struct.ver_velocity = buf.get_i16_le();
4701 let tmp = buf.get_u16_le();
4702 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4703 ::mavlink_core::error::ParserError::InvalidFlag {
4704 flag_type: "AdsbFlags",
4705 value: tmp as u32,
4706 },
4707 )?;
4708 __struct.squawk = buf.get_u16_le();
4709 let tmp = buf.get_u8();
4710 __struct.altitude_type =
4711 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4712 enum_type: "AdsbAltitudeType",
4713 value: tmp as u32,
4714 })?;
4715 for v in &mut __struct.callsign {
4716 let val = buf.get_u8();
4717 *v = val;
4718 }
4719 let tmp = buf.get_u8();
4720 __struct.emitter_type =
4721 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4722 enum_type: "AdsbEmitterType",
4723 value: tmp as u32,
4724 })?;
4725 __struct.tslc = buf.get_u8();
4726 Ok(__struct)
4727 }
4728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4729 let mut __tmp = BytesMut::new(bytes);
4730 #[allow(clippy::absurd_extreme_comparisons)]
4731 #[allow(unused_comparisons)]
4732 if __tmp.remaining() < Self::ENCODED_LEN {
4733 panic!(
4734 "buffer is too small (need {} bytes, but got {})",
4735 Self::ENCODED_LEN,
4736 __tmp.remaining(),
4737 )
4738 }
4739 __tmp.put_u32_le(self.ICAO_address);
4740 __tmp.put_i32_le(self.lat);
4741 __tmp.put_i32_le(self.lon);
4742 __tmp.put_i32_le(self.altitude);
4743 __tmp.put_u16_le(self.heading);
4744 __tmp.put_u16_le(self.hor_velocity);
4745 __tmp.put_i16_le(self.ver_velocity);
4746 __tmp.put_u16_le(self.flags.bits());
4747 __tmp.put_u16_le(self.squawk);
4748 __tmp.put_u8(self.altitude_type as u8);
4749 for val in &self.callsign {
4750 __tmp.put_u8(*val);
4751 }
4752 __tmp.put_u8(self.emitter_type as u8);
4753 __tmp.put_u8(self.tslc);
4754 if matches!(version, MavlinkVersion::V2) {
4755 let len = __tmp.len();
4756 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4757 } else {
4758 __tmp.len()
4759 }
4760 }
4761}
4762#[doc = "id: 301"]
4763#[doc = "The location and information of an AIS vessel."]
4764#[derive(Debug, Clone, PartialEq)]
4765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4766#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4767pub struct AIS_VESSEL_DATA {
4768 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4769 pub MMSI: u32,
4770 #[doc = "Latitude"]
4771 pub lat: i32,
4772 #[doc = "Longitude"]
4773 pub lon: i32,
4774 #[doc = "Course over ground"]
4775 pub COG: u16,
4776 #[doc = "True heading"]
4777 pub heading: u16,
4778 #[doc = "Speed over ground"]
4779 pub velocity: u16,
4780 #[doc = "Distance from lat/lon location to bow"]
4781 pub dimension_bow: u16,
4782 #[doc = "Distance from lat/lon location to stern"]
4783 pub dimension_stern: u16,
4784 #[doc = "Time since last communication in seconds"]
4785 pub tslc: u16,
4786 #[doc = "Bitmask to indicate various statuses including valid data fields"]
4787 pub flags: AisFlags,
4788 #[doc = "Turn rate"]
4789 pub turn_rate: i8,
4790 #[doc = "Navigational status"]
4791 pub navigational_status: AisNavStatus,
4792 #[doc = "Type of vessels"]
4793 pub mavtype: AisType,
4794 #[doc = "Distance from lat/lon location to port side"]
4795 pub dimension_port: u8,
4796 #[doc = "Distance from lat/lon location to starboard side"]
4797 pub dimension_starboard: u8,
4798 #[doc = "The vessel callsign"]
4799 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4800 pub callsign: [u8; 7],
4801 #[doc = "The vessel name"]
4802 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4803 pub name: [u8; 20],
4804}
4805impl AIS_VESSEL_DATA {
4806 pub const ENCODED_LEN: usize = 58usize;
4807 pub const DEFAULT: Self = Self {
4808 MMSI: 0_u32,
4809 lat: 0_i32,
4810 lon: 0_i32,
4811 COG: 0_u16,
4812 heading: 0_u16,
4813 velocity: 0_u16,
4814 dimension_bow: 0_u16,
4815 dimension_stern: 0_u16,
4816 tslc: 0_u16,
4817 flags: AisFlags::DEFAULT,
4818 turn_rate: 0_i8,
4819 navigational_status: AisNavStatus::DEFAULT,
4820 mavtype: AisType::DEFAULT,
4821 dimension_port: 0_u8,
4822 dimension_starboard: 0_u8,
4823 callsign: [0_u8; 7usize],
4824 name: [0_u8; 20usize],
4825 };
4826 #[cfg(feature = "arbitrary")]
4827 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4828 use arbitrary::{Arbitrary, Unstructured};
4829 let mut buf = [0u8; 1024];
4830 rng.fill_bytes(&mut buf);
4831 let mut unstructured = Unstructured::new(&buf);
4832 Self::arbitrary(&mut unstructured).unwrap_or_default()
4833 }
4834}
4835impl Default for AIS_VESSEL_DATA {
4836 fn default() -> Self {
4837 Self::DEFAULT.clone()
4838 }
4839}
4840impl MessageData for AIS_VESSEL_DATA {
4841 type Message = MavMessage;
4842 const ID: u32 = 301u32;
4843 const NAME: &'static str = "AIS_VESSEL";
4844 const EXTRA_CRC: u8 = 243u8;
4845 const ENCODED_LEN: usize = 58usize;
4846 fn deser(
4847 _version: MavlinkVersion,
4848 __input: &[u8],
4849 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4850 let avail_len = __input.len();
4851 let mut payload_buf = [0; Self::ENCODED_LEN];
4852 let mut buf = if avail_len < Self::ENCODED_LEN {
4853 payload_buf[0..avail_len].copy_from_slice(__input);
4854 Bytes::new(&payload_buf)
4855 } else {
4856 Bytes::new(__input)
4857 };
4858 let mut __struct = Self::default();
4859 __struct.MMSI = buf.get_u32_le();
4860 __struct.lat = buf.get_i32_le();
4861 __struct.lon = buf.get_i32_le();
4862 __struct.COG = buf.get_u16_le();
4863 __struct.heading = buf.get_u16_le();
4864 __struct.velocity = buf.get_u16_le();
4865 __struct.dimension_bow = buf.get_u16_le();
4866 __struct.dimension_stern = buf.get_u16_le();
4867 __struct.tslc = buf.get_u16_le();
4868 let tmp = buf.get_u16_le();
4869 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
4870 ::mavlink_core::error::ParserError::InvalidFlag {
4871 flag_type: "AisFlags",
4872 value: tmp as u32,
4873 },
4874 )?;
4875 __struct.turn_rate = buf.get_i8();
4876 let tmp = buf.get_u8();
4877 __struct.navigational_status =
4878 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4879 enum_type: "AisNavStatus",
4880 value: tmp as u32,
4881 })?;
4882 let tmp = buf.get_u8();
4883 __struct.mavtype =
4884 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4885 enum_type: "AisType",
4886 value: tmp as u32,
4887 })?;
4888 __struct.dimension_port = buf.get_u8();
4889 __struct.dimension_starboard = buf.get_u8();
4890 for v in &mut __struct.callsign {
4891 let val = buf.get_u8();
4892 *v = val;
4893 }
4894 for v in &mut __struct.name {
4895 let val = buf.get_u8();
4896 *v = val;
4897 }
4898 Ok(__struct)
4899 }
4900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4901 let mut __tmp = BytesMut::new(bytes);
4902 #[allow(clippy::absurd_extreme_comparisons)]
4903 #[allow(unused_comparisons)]
4904 if __tmp.remaining() < Self::ENCODED_LEN {
4905 panic!(
4906 "buffer is too small (need {} bytes, but got {})",
4907 Self::ENCODED_LEN,
4908 __tmp.remaining(),
4909 )
4910 }
4911 __tmp.put_u32_le(self.MMSI);
4912 __tmp.put_i32_le(self.lat);
4913 __tmp.put_i32_le(self.lon);
4914 __tmp.put_u16_le(self.COG);
4915 __tmp.put_u16_le(self.heading);
4916 __tmp.put_u16_le(self.velocity);
4917 __tmp.put_u16_le(self.dimension_bow);
4918 __tmp.put_u16_le(self.dimension_stern);
4919 __tmp.put_u16_le(self.tslc);
4920 __tmp.put_u16_le(self.flags.bits());
4921 __tmp.put_i8(self.turn_rate);
4922 __tmp.put_u8(self.navigational_status as u8);
4923 __tmp.put_u8(self.mavtype as u8);
4924 __tmp.put_u8(self.dimension_port);
4925 __tmp.put_u8(self.dimension_starboard);
4926 for val in &self.callsign {
4927 __tmp.put_u8(*val);
4928 }
4929 for val in &self.name {
4930 __tmp.put_u8(*val);
4931 }
4932 if matches!(version, MavlinkVersion::V2) {
4933 let len = __tmp.len();
4934 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4935 } else {
4936 __tmp.len()
4937 }
4938 }
4939}
4940#[doc = "id: 141"]
4941#[doc = "The current system altitude."]
4942#[derive(Debug, Clone, PartialEq)]
4943#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4944#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4945pub struct ALTITUDE_DATA {
4946 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4947 pub time_usec: u64,
4948 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
4949 pub altitude_monotonic: f32,
4950 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
4951 pub altitude_amsl: f32,
4952 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
4953 pub altitude_local: f32,
4954 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
4955 pub altitude_relative: f32,
4956 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
4957 pub altitude_terrain: f32,
4958 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
4959 pub bottom_clearance: f32,
4960}
4961impl ALTITUDE_DATA {
4962 pub const ENCODED_LEN: usize = 32usize;
4963 pub const DEFAULT: Self = Self {
4964 time_usec: 0_u64,
4965 altitude_monotonic: 0.0_f32,
4966 altitude_amsl: 0.0_f32,
4967 altitude_local: 0.0_f32,
4968 altitude_relative: 0.0_f32,
4969 altitude_terrain: 0.0_f32,
4970 bottom_clearance: 0.0_f32,
4971 };
4972 #[cfg(feature = "arbitrary")]
4973 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4974 use arbitrary::{Arbitrary, Unstructured};
4975 let mut buf = [0u8; 1024];
4976 rng.fill_bytes(&mut buf);
4977 let mut unstructured = Unstructured::new(&buf);
4978 Self::arbitrary(&mut unstructured).unwrap_or_default()
4979 }
4980}
4981impl Default for ALTITUDE_DATA {
4982 fn default() -> Self {
4983 Self::DEFAULT.clone()
4984 }
4985}
4986impl MessageData for ALTITUDE_DATA {
4987 type Message = MavMessage;
4988 const ID: u32 = 141u32;
4989 const NAME: &'static str = "ALTITUDE";
4990 const EXTRA_CRC: u8 = 47u8;
4991 const ENCODED_LEN: usize = 32usize;
4992 fn deser(
4993 _version: MavlinkVersion,
4994 __input: &[u8],
4995 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4996 let avail_len = __input.len();
4997 let mut payload_buf = [0; Self::ENCODED_LEN];
4998 let mut buf = if avail_len < Self::ENCODED_LEN {
4999 payload_buf[0..avail_len].copy_from_slice(__input);
5000 Bytes::new(&payload_buf)
5001 } else {
5002 Bytes::new(__input)
5003 };
5004 let mut __struct = Self::default();
5005 __struct.time_usec = buf.get_u64_le();
5006 __struct.altitude_monotonic = buf.get_f32_le();
5007 __struct.altitude_amsl = buf.get_f32_le();
5008 __struct.altitude_local = buf.get_f32_le();
5009 __struct.altitude_relative = buf.get_f32_le();
5010 __struct.altitude_terrain = buf.get_f32_le();
5011 __struct.bottom_clearance = buf.get_f32_le();
5012 Ok(__struct)
5013 }
5014 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5015 let mut __tmp = BytesMut::new(bytes);
5016 #[allow(clippy::absurd_extreme_comparisons)]
5017 #[allow(unused_comparisons)]
5018 if __tmp.remaining() < Self::ENCODED_LEN {
5019 panic!(
5020 "buffer is too small (need {} bytes, but got {})",
5021 Self::ENCODED_LEN,
5022 __tmp.remaining(),
5023 )
5024 }
5025 __tmp.put_u64_le(self.time_usec);
5026 __tmp.put_f32_le(self.altitude_monotonic);
5027 __tmp.put_f32_le(self.altitude_amsl);
5028 __tmp.put_f32_le(self.altitude_local);
5029 __tmp.put_f32_le(self.altitude_relative);
5030 __tmp.put_f32_le(self.altitude_terrain);
5031 __tmp.put_f32_le(self.bottom_clearance);
5032 if matches!(version, MavlinkVersion::V2) {
5033 let len = __tmp.len();
5034 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5035 } else {
5036 __tmp.len()
5037 }
5038 }
5039}
5040#[doc = "id: 30"]
5041#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5042#[derive(Debug, Clone, PartialEq)]
5043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5045pub struct ATTITUDE_DATA {
5046 #[doc = "Timestamp (time since system boot)."]
5047 pub time_boot_ms: u32,
5048 #[doc = "Roll angle (-pi..+pi)"]
5049 pub roll: f32,
5050 #[doc = "Pitch angle (-pi..+pi)"]
5051 pub pitch: f32,
5052 #[doc = "Yaw angle (-pi..+pi)"]
5053 pub yaw: f32,
5054 #[doc = "Roll angular speed"]
5055 pub rollspeed: f32,
5056 #[doc = "Pitch angular speed"]
5057 pub pitchspeed: f32,
5058 #[doc = "Yaw angular speed"]
5059 pub yawspeed: f32,
5060}
5061impl ATTITUDE_DATA {
5062 pub const ENCODED_LEN: usize = 28usize;
5063 pub const DEFAULT: Self = Self {
5064 time_boot_ms: 0_u32,
5065 roll: 0.0_f32,
5066 pitch: 0.0_f32,
5067 yaw: 0.0_f32,
5068 rollspeed: 0.0_f32,
5069 pitchspeed: 0.0_f32,
5070 yawspeed: 0.0_f32,
5071 };
5072 #[cfg(feature = "arbitrary")]
5073 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5074 use arbitrary::{Arbitrary, Unstructured};
5075 let mut buf = [0u8; 1024];
5076 rng.fill_bytes(&mut buf);
5077 let mut unstructured = Unstructured::new(&buf);
5078 Self::arbitrary(&mut unstructured).unwrap_or_default()
5079 }
5080}
5081impl Default for ATTITUDE_DATA {
5082 fn default() -> Self {
5083 Self::DEFAULT.clone()
5084 }
5085}
5086impl MessageData for ATTITUDE_DATA {
5087 type Message = MavMessage;
5088 const ID: u32 = 30u32;
5089 const NAME: &'static str = "ATTITUDE";
5090 const EXTRA_CRC: u8 = 39u8;
5091 const ENCODED_LEN: usize = 28usize;
5092 fn deser(
5093 _version: MavlinkVersion,
5094 __input: &[u8],
5095 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5096 let avail_len = __input.len();
5097 let mut payload_buf = [0; Self::ENCODED_LEN];
5098 let mut buf = if avail_len < Self::ENCODED_LEN {
5099 payload_buf[0..avail_len].copy_from_slice(__input);
5100 Bytes::new(&payload_buf)
5101 } else {
5102 Bytes::new(__input)
5103 };
5104 let mut __struct = Self::default();
5105 __struct.time_boot_ms = buf.get_u32_le();
5106 __struct.roll = buf.get_f32_le();
5107 __struct.pitch = buf.get_f32_le();
5108 __struct.yaw = buf.get_f32_le();
5109 __struct.rollspeed = buf.get_f32_le();
5110 __struct.pitchspeed = buf.get_f32_le();
5111 __struct.yawspeed = buf.get_f32_le();
5112 Ok(__struct)
5113 }
5114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5115 let mut __tmp = BytesMut::new(bytes);
5116 #[allow(clippy::absurd_extreme_comparisons)]
5117 #[allow(unused_comparisons)]
5118 if __tmp.remaining() < Self::ENCODED_LEN {
5119 panic!(
5120 "buffer is too small (need {} bytes, but got {})",
5121 Self::ENCODED_LEN,
5122 __tmp.remaining(),
5123 )
5124 }
5125 __tmp.put_u32_le(self.time_boot_ms);
5126 __tmp.put_f32_le(self.roll);
5127 __tmp.put_f32_le(self.pitch);
5128 __tmp.put_f32_le(self.yaw);
5129 __tmp.put_f32_le(self.rollspeed);
5130 __tmp.put_f32_le(self.pitchspeed);
5131 __tmp.put_f32_le(self.yawspeed);
5132 if matches!(version, MavlinkVersion::V2) {
5133 let len = __tmp.len();
5134 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5135 } else {
5136 __tmp.len()
5137 }
5138 }
5139}
5140#[doc = "id: 31"]
5141#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5142#[derive(Debug, Clone, PartialEq)]
5143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5145pub struct ATTITUDE_QUATERNION_DATA {
5146 #[doc = "Timestamp (time since system boot)."]
5147 pub time_boot_ms: u32,
5148 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5149 pub q1: f32,
5150 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5151 pub q2: f32,
5152 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5153 pub q3: f32,
5154 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5155 pub q4: f32,
5156 #[doc = "Roll angular speed"]
5157 pub rollspeed: f32,
5158 #[doc = "Pitch angular speed"]
5159 pub pitchspeed: f32,
5160 #[doc = "Yaw angular speed"]
5161 pub yawspeed: f32,
5162 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5164 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5165 pub repr_offset_q: [f32; 4],
5166}
5167impl ATTITUDE_QUATERNION_DATA {
5168 pub const ENCODED_LEN: usize = 48usize;
5169 pub const DEFAULT: Self = Self {
5170 time_boot_ms: 0_u32,
5171 q1: 0.0_f32,
5172 q2: 0.0_f32,
5173 q3: 0.0_f32,
5174 q4: 0.0_f32,
5175 rollspeed: 0.0_f32,
5176 pitchspeed: 0.0_f32,
5177 yawspeed: 0.0_f32,
5178 repr_offset_q: [0.0_f32; 4usize],
5179 };
5180 #[cfg(feature = "arbitrary")]
5181 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5182 use arbitrary::{Arbitrary, Unstructured};
5183 let mut buf = [0u8; 1024];
5184 rng.fill_bytes(&mut buf);
5185 let mut unstructured = Unstructured::new(&buf);
5186 Self::arbitrary(&mut unstructured).unwrap_or_default()
5187 }
5188}
5189impl Default for ATTITUDE_QUATERNION_DATA {
5190 fn default() -> Self {
5191 Self::DEFAULT.clone()
5192 }
5193}
5194impl MessageData for ATTITUDE_QUATERNION_DATA {
5195 type Message = MavMessage;
5196 const ID: u32 = 31u32;
5197 const NAME: &'static str = "ATTITUDE_QUATERNION";
5198 const EXTRA_CRC: u8 = 246u8;
5199 const ENCODED_LEN: usize = 48usize;
5200 fn deser(
5201 _version: MavlinkVersion,
5202 __input: &[u8],
5203 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5204 let avail_len = __input.len();
5205 let mut payload_buf = [0; Self::ENCODED_LEN];
5206 let mut buf = if avail_len < Self::ENCODED_LEN {
5207 payload_buf[0..avail_len].copy_from_slice(__input);
5208 Bytes::new(&payload_buf)
5209 } else {
5210 Bytes::new(__input)
5211 };
5212 let mut __struct = Self::default();
5213 __struct.time_boot_ms = buf.get_u32_le();
5214 __struct.q1 = buf.get_f32_le();
5215 __struct.q2 = buf.get_f32_le();
5216 __struct.q3 = buf.get_f32_le();
5217 __struct.q4 = buf.get_f32_le();
5218 __struct.rollspeed = buf.get_f32_le();
5219 __struct.pitchspeed = buf.get_f32_le();
5220 __struct.yawspeed = buf.get_f32_le();
5221 for v in &mut __struct.repr_offset_q {
5222 let val = buf.get_f32_le();
5223 *v = val;
5224 }
5225 Ok(__struct)
5226 }
5227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5228 let mut __tmp = BytesMut::new(bytes);
5229 #[allow(clippy::absurd_extreme_comparisons)]
5230 #[allow(unused_comparisons)]
5231 if __tmp.remaining() < Self::ENCODED_LEN {
5232 panic!(
5233 "buffer is too small (need {} bytes, but got {})",
5234 Self::ENCODED_LEN,
5235 __tmp.remaining(),
5236 )
5237 }
5238 __tmp.put_u32_le(self.time_boot_ms);
5239 __tmp.put_f32_le(self.q1);
5240 __tmp.put_f32_le(self.q2);
5241 __tmp.put_f32_le(self.q3);
5242 __tmp.put_f32_le(self.q4);
5243 __tmp.put_f32_le(self.rollspeed);
5244 __tmp.put_f32_le(self.pitchspeed);
5245 __tmp.put_f32_le(self.yawspeed);
5246 for val in &self.repr_offset_q {
5247 __tmp.put_f32_le(*val);
5248 }
5249 if matches!(version, MavlinkVersion::V2) {
5250 let len = __tmp.len();
5251 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5252 } else {
5253 __tmp.len()
5254 }
5255 }
5256}
5257#[doc = "id: 61"]
5258#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5259#[derive(Debug, Clone, PartialEq)]
5260#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5262pub struct ATTITUDE_QUATERNION_COV_DATA {
5263 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5264 pub time_usec: u64,
5265 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5266 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5267 pub q: [f32; 4],
5268 #[doc = "Roll angular speed"]
5269 pub rollspeed: f32,
5270 #[doc = "Pitch angular speed"]
5271 pub pitchspeed: f32,
5272 #[doc = "Yaw angular speed"]
5273 pub yawspeed: f32,
5274 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5275 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5276 pub covariance: [f32; 9],
5277}
5278impl ATTITUDE_QUATERNION_COV_DATA {
5279 pub const ENCODED_LEN: usize = 72usize;
5280 pub const DEFAULT: Self = Self {
5281 time_usec: 0_u64,
5282 q: [0.0_f32; 4usize],
5283 rollspeed: 0.0_f32,
5284 pitchspeed: 0.0_f32,
5285 yawspeed: 0.0_f32,
5286 covariance: [0.0_f32; 9usize],
5287 };
5288 #[cfg(feature = "arbitrary")]
5289 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5290 use arbitrary::{Arbitrary, Unstructured};
5291 let mut buf = [0u8; 1024];
5292 rng.fill_bytes(&mut buf);
5293 let mut unstructured = Unstructured::new(&buf);
5294 Self::arbitrary(&mut unstructured).unwrap_or_default()
5295 }
5296}
5297impl Default for ATTITUDE_QUATERNION_COV_DATA {
5298 fn default() -> Self {
5299 Self::DEFAULT.clone()
5300 }
5301}
5302impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5303 type Message = MavMessage;
5304 const ID: u32 = 61u32;
5305 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5306 const EXTRA_CRC: u8 = 167u8;
5307 const ENCODED_LEN: usize = 72usize;
5308 fn deser(
5309 _version: MavlinkVersion,
5310 __input: &[u8],
5311 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5312 let avail_len = __input.len();
5313 let mut payload_buf = [0; Self::ENCODED_LEN];
5314 let mut buf = if avail_len < Self::ENCODED_LEN {
5315 payload_buf[0..avail_len].copy_from_slice(__input);
5316 Bytes::new(&payload_buf)
5317 } else {
5318 Bytes::new(__input)
5319 };
5320 let mut __struct = Self::default();
5321 __struct.time_usec = buf.get_u64_le();
5322 for v in &mut __struct.q {
5323 let val = buf.get_f32_le();
5324 *v = val;
5325 }
5326 __struct.rollspeed = buf.get_f32_le();
5327 __struct.pitchspeed = buf.get_f32_le();
5328 __struct.yawspeed = buf.get_f32_le();
5329 for v in &mut __struct.covariance {
5330 let val = buf.get_f32_le();
5331 *v = val;
5332 }
5333 Ok(__struct)
5334 }
5335 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5336 let mut __tmp = BytesMut::new(bytes);
5337 #[allow(clippy::absurd_extreme_comparisons)]
5338 #[allow(unused_comparisons)]
5339 if __tmp.remaining() < Self::ENCODED_LEN {
5340 panic!(
5341 "buffer is too small (need {} bytes, but got {})",
5342 Self::ENCODED_LEN,
5343 __tmp.remaining(),
5344 )
5345 }
5346 __tmp.put_u64_le(self.time_usec);
5347 for val in &self.q {
5348 __tmp.put_f32_le(*val);
5349 }
5350 __tmp.put_f32_le(self.rollspeed);
5351 __tmp.put_f32_le(self.pitchspeed);
5352 __tmp.put_f32_le(self.yawspeed);
5353 for val in &self.covariance {
5354 __tmp.put_f32_le(*val);
5355 }
5356 if matches!(version, MavlinkVersion::V2) {
5357 let len = __tmp.len();
5358 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5359 } else {
5360 __tmp.len()
5361 }
5362 }
5363}
5364#[doc = "id: 83"]
5365#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5366#[derive(Debug, Clone, PartialEq)]
5367#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5368#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5369pub struct ATTITUDE_TARGET_DATA {
5370 #[doc = "Timestamp (time since system boot)."]
5371 pub time_boot_ms: u32,
5372 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5373 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5374 pub q: [f32; 4],
5375 #[doc = "Body roll rate"]
5376 pub body_roll_rate: f32,
5377 #[doc = "Body pitch rate"]
5378 pub body_pitch_rate: f32,
5379 #[doc = "Body yaw rate"]
5380 pub body_yaw_rate: f32,
5381 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5382 pub thrust: f32,
5383 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5384 pub type_mask: AttitudeTargetTypemask,
5385}
5386impl ATTITUDE_TARGET_DATA {
5387 pub const ENCODED_LEN: usize = 37usize;
5388 pub const DEFAULT: Self = Self {
5389 time_boot_ms: 0_u32,
5390 q: [0.0_f32; 4usize],
5391 body_roll_rate: 0.0_f32,
5392 body_pitch_rate: 0.0_f32,
5393 body_yaw_rate: 0.0_f32,
5394 thrust: 0.0_f32,
5395 type_mask: AttitudeTargetTypemask::DEFAULT,
5396 };
5397 #[cfg(feature = "arbitrary")]
5398 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5399 use arbitrary::{Arbitrary, Unstructured};
5400 let mut buf = [0u8; 1024];
5401 rng.fill_bytes(&mut buf);
5402 let mut unstructured = Unstructured::new(&buf);
5403 Self::arbitrary(&mut unstructured).unwrap_or_default()
5404 }
5405}
5406impl Default for ATTITUDE_TARGET_DATA {
5407 fn default() -> Self {
5408 Self::DEFAULT.clone()
5409 }
5410}
5411impl MessageData for ATTITUDE_TARGET_DATA {
5412 type Message = MavMessage;
5413 const ID: u32 = 83u32;
5414 const NAME: &'static str = "ATTITUDE_TARGET";
5415 const EXTRA_CRC: u8 = 22u8;
5416 const ENCODED_LEN: usize = 37usize;
5417 fn deser(
5418 _version: MavlinkVersion,
5419 __input: &[u8],
5420 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5421 let avail_len = __input.len();
5422 let mut payload_buf = [0; Self::ENCODED_LEN];
5423 let mut buf = if avail_len < Self::ENCODED_LEN {
5424 payload_buf[0..avail_len].copy_from_slice(__input);
5425 Bytes::new(&payload_buf)
5426 } else {
5427 Bytes::new(__input)
5428 };
5429 let mut __struct = Self::default();
5430 __struct.time_boot_ms = buf.get_u32_le();
5431 for v in &mut __struct.q {
5432 let val = buf.get_f32_le();
5433 *v = val;
5434 }
5435 __struct.body_roll_rate = buf.get_f32_le();
5436 __struct.body_pitch_rate = buf.get_f32_le();
5437 __struct.body_yaw_rate = buf.get_f32_le();
5438 __struct.thrust = buf.get_f32_le();
5439 let tmp = buf.get_u8();
5440 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5441 tmp & AttitudeTargetTypemask::all().bits(),
5442 )
5443 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5444 flag_type: "AttitudeTargetTypemask",
5445 value: tmp as u32,
5446 })?;
5447 Ok(__struct)
5448 }
5449 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5450 let mut __tmp = BytesMut::new(bytes);
5451 #[allow(clippy::absurd_extreme_comparisons)]
5452 #[allow(unused_comparisons)]
5453 if __tmp.remaining() < Self::ENCODED_LEN {
5454 panic!(
5455 "buffer is too small (need {} bytes, but got {})",
5456 Self::ENCODED_LEN,
5457 __tmp.remaining(),
5458 )
5459 }
5460 __tmp.put_u32_le(self.time_boot_ms);
5461 for val in &self.q {
5462 __tmp.put_f32_le(*val);
5463 }
5464 __tmp.put_f32_le(self.body_roll_rate);
5465 __tmp.put_f32_le(self.body_pitch_rate);
5466 __tmp.put_f32_le(self.body_yaw_rate);
5467 __tmp.put_f32_le(self.thrust);
5468 __tmp.put_u8(self.type_mask.bits());
5469 if matches!(version, MavlinkVersion::V2) {
5470 let len = __tmp.len();
5471 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5472 } else {
5473 __tmp.len()
5474 }
5475 }
5476}
5477#[doc = "id: 138"]
5478#[doc = "Motion capture attitude and position."]
5479#[derive(Debug, Clone, PartialEq)]
5480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5481#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5482pub struct ATT_POS_MOCAP_DATA {
5483 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5484 pub time_usec: u64,
5485 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5486 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5487 pub q: [f32; 4],
5488 #[doc = "X position (NED)"]
5489 pub x: f32,
5490 #[doc = "Y position (NED)"]
5491 pub y: f32,
5492 #[doc = "Z position (NED)"]
5493 pub z: f32,
5494 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5495 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5496 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5497 pub covariance: [f32; 21],
5498}
5499impl ATT_POS_MOCAP_DATA {
5500 pub const ENCODED_LEN: usize = 120usize;
5501 pub const DEFAULT: Self = Self {
5502 time_usec: 0_u64,
5503 q: [0.0_f32; 4usize],
5504 x: 0.0_f32,
5505 y: 0.0_f32,
5506 z: 0.0_f32,
5507 covariance: [0.0_f32; 21usize],
5508 };
5509 #[cfg(feature = "arbitrary")]
5510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5511 use arbitrary::{Arbitrary, Unstructured};
5512 let mut buf = [0u8; 1024];
5513 rng.fill_bytes(&mut buf);
5514 let mut unstructured = Unstructured::new(&buf);
5515 Self::arbitrary(&mut unstructured).unwrap_or_default()
5516 }
5517}
5518impl Default for ATT_POS_MOCAP_DATA {
5519 fn default() -> Self {
5520 Self::DEFAULT.clone()
5521 }
5522}
5523impl MessageData for ATT_POS_MOCAP_DATA {
5524 type Message = MavMessage;
5525 const ID: u32 = 138u32;
5526 const NAME: &'static str = "ATT_POS_MOCAP";
5527 const EXTRA_CRC: u8 = 109u8;
5528 const ENCODED_LEN: usize = 120usize;
5529 fn deser(
5530 _version: MavlinkVersion,
5531 __input: &[u8],
5532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5533 let avail_len = __input.len();
5534 let mut payload_buf = [0; Self::ENCODED_LEN];
5535 let mut buf = if avail_len < Self::ENCODED_LEN {
5536 payload_buf[0..avail_len].copy_from_slice(__input);
5537 Bytes::new(&payload_buf)
5538 } else {
5539 Bytes::new(__input)
5540 };
5541 let mut __struct = Self::default();
5542 __struct.time_usec = buf.get_u64_le();
5543 for v in &mut __struct.q {
5544 let val = buf.get_f32_le();
5545 *v = val;
5546 }
5547 __struct.x = buf.get_f32_le();
5548 __struct.y = buf.get_f32_le();
5549 __struct.z = buf.get_f32_le();
5550 for v in &mut __struct.covariance {
5551 let val = buf.get_f32_le();
5552 *v = val;
5553 }
5554 Ok(__struct)
5555 }
5556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5557 let mut __tmp = BytesMut::new(bytes);
5558 #[allow(clippy::absurd_extreme_comparisons)]
5559 #[allow(unused_comparisons)]
5560 if __tmp.remaining() < Self::ENCODED_LEN {
5561 panic!(
5562 "buffer is too small (need {} bytes, but got {})",
5563 Self::ENCODED_LEN,
5564 __tmp.remaining(),
5565 )
5566 }
5567 __tmp.put_u64_le(self.time_usec);
5568 for val in &self.q {
5569 __tmp.put_f32_le(*val);
5570 }
5571 __tmp.put_f32_le(self.x);
5572 __tmp.put_f32_le(self.y);
5573 __tmp.put_f32_le(self.z);
5574 for val in &self.covariance {
5575 __tmp.put_f32_le(*val);
5576 }
5577 if matches!(version, MavlinkVersion::V2) {
5578 let len = __tmp.len();
5579 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5580 } else {
5581 __tmp.len()
5582 }
5583 }
5584}
5585#[doc = "id: 7"]
5586#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5587#[derive(Debug, Clone, PartialEq)]
5588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5590pub struct AUTH_KEY_DATA {
5591 #[doc = "key"]
5592 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5593 pub key: [u8; 32],
5594}
5595impl AUTH_KEY_DATA {
5596 pub const ENCODED_LEN: usize = 32usize;
5597 pub const DEFAULT: Self = Self {
5598 key: [0_u8; 32usize],
5599 };
5600 #[cfg(feature = "arbitrary")]
5601 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5602 use arbitrary::{Arbitrary, Unstructured};
5603 let mut buf = [0u8; 1024];
5604 rng.fill_bytes(&mut buf);
5605 let mut unstructured = Unstructured::new(&buf);
5606 Self::arbitrary(&mut unstructured).unwrap_or_default()
5607 }
5608}
5609impl Default for AUTH_KEY_DATA {
5610 fn default() -> Self {
5611 Self::DEFAULT.clone()
5612 }
5613}
5614impl MessageData for AUTH_KEY_DATA {
5615 type Message = MavMessage;
5616 const ID: u32 = 7u32;
5617 const NAME: &'static str = "AUTH_KEY";
5618 const EXTRA_CRC: u8 = 119u8;
5619 const ENCODED_LEN: usize = 32usize;
5620 fn deser(
5621 _version: MavlinkVersion,
5622 __input: &[u8],
5623 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5624 let avail_len = __input.len();
5625 let mut payload_buf = [0; Self::ENCODED_LEN];
5626 let mut buf = if avail_len < Self::ENCODED_LEN {
5627 payload_buf[0..avail_len].copy_from_slice(__input);
5628 Bytes::new(&payload_buf)
5629 } else {
5630 Bytes::new(__input)
5631 };
5632 let mut __struct = Self::default();
5633 for v in &mut __struct.key {
5634 let val = buf.get_u8();
5635 *v = val;
5636 }
5637 Ok(__struct)
5638 }
5639 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5640 let mut __tmp = BytesMut::new(bytes);
5641 #[allow(clippy::absurd_extreme_comparisons)]
5642 #[allow(unused_comparisons)]
5643 if __tmp.remaining() < Self::ENCODED_LEN {
5644 panic!(
5645 "buffer is too small (need {} bytes, but got {})",
5646 Self::ENCODED_LEN,
5647 __tmp.remaining(),
5648 )
5649 }
5650 for val in &self.key {
5651 __tmp.put_u8(*val);
5652 }
5653 if matches!(version, MavlinkVersion::V2) {
5654 let len = __tmp.len();
5655 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5656 } else {
5657 __tmp.len()
5658 }
5659 }
5660}
5661#[doc = "id: 286"]
5662#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5663#[derive(Debug, Clone, PartialEq)]
5664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5666pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5667 #[doc = "Timestamp (time since system boot)."]
5668 pub time_boot_us: u64,
5669 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5670 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5671 pub q: [f32; 4],
5672 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5673 pub q_estimated_delay_us: u32,
5674 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5675 pub vx: f32,
5676 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5677 pub vy: f32,
5678 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5679 pub vz: f32,
5680 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5681 pub v_estimated_delay_us: u32,
5682 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5683 pub feed_forward_angular_velocity_z: f32,
5684 #[doc = "Bitmap indicating which estimator outputs are valid."]
5685 pub estimator_status: EstimatorStatusFlags,
5686 #[doc = "System ID"]
5687 pub target_system: u8,
5688 #[doc = "Component ID"]
5689 pub target_component: u8,
5690 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5691 pub landed_state: MavLandedState,
5692 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5693 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5694 pub angular_velocity_z: f32,
5695}
5696impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5697 pub const ENCODED_LEN: usize = 57usize;
5698 pub const DEFAULT: Self = Self {
5699 time_boot_us: 0_u64,
5700 q: [0.0_f32; 4usize],
5701 q_estimated_delay_us: 0_u32,
5702 vx: 0.0_f32,
5703 vy: 0.0_f32,
5704 vz: 0.0_f32,
5705 v_estimated_delay_us: 0_u32,
5706 feed_forward_angular_velocity_z: 0.0_f32,
5707 estimator_status: EstimatorStatusFlags::DEFAULT,
5708 target_system: 0_u8,
5709 target_component: 0_u8,
5710 landed_state: MavLandedState::DEFAULT,
5711 angular_velocity_z: 0.0_f32,
5712 };
5713 #[cfg(feature = "arbitrary")]
5714 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5715 use arbitrary::{Arbitrary, Unstructured};
5716 let mut buf = [0u8; 1024];
5717 rng.fill_bytes(&mut buf);
5718 let mut unstructured = Unstructured::new(&buf);
5719 Self::arbitrary(&mut unstructured).unwrap_or_default()
5720 }
5721}
5722impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5723 fn default() -> Self {
5724 Self::DEFAULT.clone()
5725 }
5726}
5727impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5728 type Message = MavMessage;
5729 const ID: u32 = 286u32;
5730 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
5731 const EXTRA_CRC: u8 = 210u8;
5732 const ENCODED_LEN: usize = 57usize;
5733 fn deser(
5734 _version: MavlinkVersion,
5735 __input: &[u8],
5736 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5737 let avail_len = __input.len();
5738 let mut payload_buf = [0; Self::ENCODED_LEN];
5739 let mut buf = if avail_len < Self::ENCODED_LEN {
5740 payload_buf[0..avail_len].copy_from_slice(__input);
5741 Bytes::new(&payload_buf)
5742 } else {
5743 Bytes::new(__input)
5744 };
5745 let mut __struct = Self::default();
5746 __struct.time_boot_us = buf.get_u64_le();
5747 for v in &mut __struct.q {
5748 let val = buf.get_f32_le();
5749 *v = val;
5750 }
5751 __struct.q_estimated_delay_us = buf.get_u32_le();
5752 __struct.vx = buf.get_f32_le();
5753 __struct.vy = buf.get_f32_le();
5754 __struct.vz = buf.get_f32_le();
5755 __struct.v_estimated_delay_us = buf.get_u32_le();
5756 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
5757 let tmp = buf.get_u16_le();
5758 __struct.estimator_status = EstimatorStatusFlags::from_bits(
5759 tmp & EstimatorStatusFlags::all().bits(),
5760 )
5761 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5762 flag_type: "EstimatorStatusFlags",
5763 value: tmp as u32,
5764 })?;
5765 __struct.target_system = buf.get_u8();
5766 __struct.target_component = buf.get_u8();
5767 let tmp = buf.get_u8();
5768 __struct.landed_state =
5769 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5770 enum_type: "MavLandedState",
5771 value: tmp as u32,
5772 })?;
5773 __struct.angular_velocity_z = buf.get_f32_le();
5774 Ok(__struct)
5775 }
5776 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5777 let mut __tmp = BytesMut::new(bytes);
5778 #[allow(clippy::absurd_extreme_comparisons)]
5779 #[allow(unused_comparisons)]
5780 if __tmp.remaining() < Self::ENCODED_LEN {
5781 panic!(
5782 "buffer is too small (need {} bytes, but got {})",
5783 Self::ENCODED_LEN,
5784 __tmp.remaining(),
5785 )
5786 }
5787 __tmp.put_u64_le(self.time_boot_us);
5788 for val in &self.q {
5789 __tmp.put_f32_le(*val);
5790 }
5791 __tmp.put_u32_le(self.q_estimated_delay_us);
5792 __tmp.put_f32_le(self.vx);
5793 __tmp.put_f32_le(self.vy);
5794 __tmp.put_f32_le(self.vz);
5795 __tmp.put_u32_le(self.v_estimated_delay_us);
5796 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
5797 __tmp.put_u16_le(self.estimator_status.bits());
5798 __tmp.put_u8(self.target_system);
5799 __tmp.put_u8(self.target_component);
5800 __tmp.put_u8(self.landed_state as u8);
5801 __tmp.put_f32_le(self.angular_velocity_z);
5802 if matches!(version, MavlinkVersion::V2) {
5803 let len = __tmp.len();
5804 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5805 } else {
5806 __tmp.len()
5807 }
5808 }
5809}
5810#[doc = "id: 148"]
5811#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
5812#[derive(Debug, Clone, PartialEq)]
5813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5815pub struct AUTOPILOT_VERSION_DATA {
5816 #[doc = "Bitmap of capabilities"]
5817 pub capabilities: MavProtocolCapability,
5818 #[doc = "UID if provided by hardware (see uid2)"]
5819 pub uid: u64,
5820 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
5821 pub flight_sw_version: u32,
5822 #[doc = "Middleware version number"]
5823 pub middleware_sw_version: u32,
5824 #[doc = "Operating system version number"]
5825 pub os_sw_version: u32,
5826 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
5827 pub board_version: u32,
5828 #[doc = "ID of the board vendor"]
5829 pub vendor_id: u16,
5830 #[doc = "ID of the product"]
5831 pub product_id: u16,
5832 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5833 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5834 pub flight_custom_version: [u8; 8],
5835 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5836 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5837 pub middleware_custom_version: [u8; 8],
5838 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5839 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5840 pub os_custom_version: [u8; 8],
5841 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
5842 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5843 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5844 pub uid2: [u8; 18],
5845}
5846impl AUTOPILOT_VERSION_DATA {
5847 pub const ENCODED_LEN: usize = 78usize;
5848 pub const DEFAULT: Self = Self {
5849 capabilities: MavProtocolCapability::DEFAULT,
5850 uid: 0_u64,
5851 flight_sw_version: 0_u32,
5852 middleware_sw_version: 0_u32,
5853 os_sw_version: 0_u32,
5854 board_version: 0_u32,
5855 vendor_id: 0_u16,
5856 product_id: 0_u16,
5857 flight_custom_version: [0_u8; 8usize],
5858 middleware_custom_version: [0_u8; 8usize],
5859 os_custom_version: [0_u8; 8usize],
5860 uid2: [0_u8; 18usize],
5861 };
5862 #[cfg(feature = "arbitrary")]
5863 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5864 use arbitrary::{Arbitrary, Unstructured};
5865 let mut buf = [0u8; 1024];
5866 rng.fill_bytes(&mut buf);
5867 let mut unstructured = Unstructured::new(&buf);
5868 Self::arbitrary(&mut unstructured).unwrap_or_default()
5869 }
5870}
5871impl Default for AUTOPILOT_VERSION_DATA {
5872 fn default() -> Self {
5873 Self::DEFAULT.clone()
5874 }
5875}
5876impl MessageData for AUTOPILOT_VERSION_DATA {
5877 type Message = MavMessage;
5878 const ID: u32 = 148u32;
5879 const NAME: &'static str = "AUTOPILOT_VERSION";
5880 const EXTRA_CRC: u8 = 178u8;
5881 const ENCODED_LEN: usize = 78usize;
5882 fn deser(
5883 _version: MavlinkVersion,
5884 __input: &[u8],
5885 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5886 let avail_len = __input.len();
5887 let mut payload_buf = [0; Self::ENCODED_LEN];
5888 let mut buf = if avail_len < Self::ENCODED_LEN {
5889 payload_buf[0..avail_len].copy_from_slice(__input);
5890 Bytes::new(&payload_buf)
5891 } else {
5892 Bytes::new(__input)
5893 };
5894 let mut __struct = Self::default();
5895 let tmp = buf.get_u64_le();
5896 __struct.capabilities = MavProtocolCapability::from_bits(
5897 tmp & MavProtocolCapability::all().bits(),
5898 )
5899 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5900 flag_type: "MavProtocolCapability",
5901 value: tmp as u32,
5902 })?;
5903 __struct.uid = buf.get_u64_le();
5904 __struct.flight_sw_version = buf.get_u32_le();
5905 __struct.middleware_sw_version = buf.get_u32_le();
5906 __struct.os_sw_version = buf.get_u32_le();
5907 __struct.board_version = buf.get_u32_le();
5908 __struct.vendor_id = buf.get_u16_le();
5909 __struct.product_id = buf.get_u16_le();
5910 for v in &mut __struct.flight_custom_version {
5911 let val = buf.get_u8();
5912 *v = val;
5913 }
5914 for v in &mut __struct.middleware_custom_version {
5915 let val = buf.get_u8();
5916 *v = val;
5917 }
5918 for v in &mut __struct.os_custom_version {
5919 let val = buf.get_u8();
5920 *v = val;
5921 }
5922 for v in &mut __struct.uid2 {
5923 let val = buf.get_u8();
5924 *v = val;
5925 }
5926 Ok(__struct)
5927 }
5928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5929 let mut __tmp = BytesMut::new(bytes);
5930 #[allow(clippy::absurd_extreme_comparisons)]
5931 #[allow(unused_comparisons)]
5932 if __tmp.remaining() < Self::ENCODED_LEN {
5933 panic!(
5934 "buffer is too small (need {} bytes, but got {})",
5935 Self::ENCODED_LEN,
5936 __tmp.remaining(),
5937 )
5938 }
5939 __tmp.put_u64_le(self.capabilities.bits());
5940 __tmp.put_u64_le(self.uid);
5941 __tmp.put_u32_le(self.flight_sw_version);
5942 __tmp.put_u32_le(self.middleware_sw_version);
5943 __tmp.put_u32_le(self.os_sw_version);
5944 __tmp.put_u32_le(self.board_version);
5945 __tmp.put_u16_le(self.vendor_id);
5946 __tmp.put_u16_le(self.product_id);
5947 for val in &self.flight_custom_version {
5948 __tmp.put_u8(*val);
5949 }
5950 for val in &self.middleware_custom_version {
5951 __tmp.put_u8(*val);
5952 }
5953 for val in &self.os_custom_version {
5954 __tmp.put_u8(*val);
5955 }
5956 for val in &self.uid2 {
5957 __tmp.put_u8(*val);
5958 }
5959 if matches!(version, MavlinkVersion::V2) {
5960 let len = __tmp.len();
5961 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5962 } else {
5963 __tmp.len()
5964 }
5965 }
5966}
5967#[doc = "id: 435"]
5968#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
5969#[derive(Debug, Clone, PartialEq)]
5970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5971#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5972pub struct AVAILABLE_MODES_DATA {
5973 #[doc = "A bitfield for use for autopilot-specific flags"]
5974 pub custom_mode: u32,
5975 #[doc = "Mode properties."]
5976 pub properties: MavModeProperty,
5977 #[doc = "The total number of available modes for the current vehicle type."]
5978 pub number_modes: u8,
5979 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
5980 pub mode_index: u8,
5981 #[doc = "Standard mode."]
5982 pub standard_mode: MavStandardMode,
5983 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
5984 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5985 pub mode_name: [u8; 35],
5986}
5987impl AVAILABLE_MODES_DATA {
5988 pub const ENCODED_LEN: usize = 46usize;
5989 pub const DEFAULT: Self = Self {
5990 custom_mode: 0_u32,
5991 properties: MavModeProperty::DEFAULT,
5992 number_modes: 0_u8,
5993 mode_index: 0_u8,
5994 standard_mode: MavStandardMode::DEFAULT,
5995 mode_name: [0_u8; 35usize],
5996 };
5997 #[cfg(feature = "arbitrary")]
5998 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5999 use arbitrary::{Arbitrary, Unstructured};
6000 let mut buf = [0u8; 1024];
6001 rng.fill_bytes(&mut buf);
6002 let mut unstructured = Unstructured::new(&buf);
6003 Self::arbitrary(&mut unstructured).unwrap_or_default()
6004 }
6005}
6006impl Default for AVAILABLE_MODES_DATA {
6007 fn default() -> Self {
6008 Self::DEFAULT.clone()
6009 }
6010}
6011impl MessageData for AVAILABLE_MODES_DATA {
6012 type Message = MavMessage;
6013 const ID: u32 = 435u32;
6014 const NAME: &'static str = "AVAILABLE_MODES";
6015 const EXTRA_CRC: u8 = 134u8;
6016 const ENCODED_LEN: usize = 46usize;
6017 fn deser(
6018 _version: MavlinkVersion,
6019 __input: &[u8],
6020 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6021 let avail_len = __input.len();
6022 let mut payload_buf = [0; Self::ENCODED_LEN];
6023 let mut buf = if avail_len < Self::ENCODED_LEN {
6024 payload_buf[0..avail_len].copy_from_slice(__input);
6025 Bytes::new(&payload_buf)
6026 } else {
6027 Bytes::new(__input)
6028 };
6029 let mut __struct = Self::default();
6030 __struct.custom_mode = buf.get_u32_le();
6031 let tmp = buf.get_u32_le();
6032 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6033 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6034 flag_type: "MavModeProperty",
6035 value: tmp as u32,
6036 })?;
6037 __struct.number_modes = buf.get_u8();
6038 __struct.mode_index = buf.get_u8();
6039 let tmp = buf.get_u8();
6040 __struct.standard_mode =
6041 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6042 enum_type: "MavStandardMode",
6043 value: tmp as u32,
6044 })?;
6045 for v in &mut __struct.mode_name {
6046 let val = buf.get_u8();
6047 *v = val;
6048 }
6049 Ok(__struct)
6050 }
6051 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6052 let mut __tmp = BytesMut::new(bytes);
6053 #[allow(clippy::absurd_extreme_comparisons)]
6054 #[allow(unused_comparisons)]
6055 if __tmp.remaining() < Self::ENCODED_LEN {
6056 panic!(
6057 "buffer is too small (need {} bytes, but got {})",
6058 Self::ENCODED_LEN,
6059 __tmp.remaining(),
6060 )
6061 }
6062 __tmp.put_u32_le(self.custom_mode);
6063 __tmp.put_u32_le(self.properties.bits());
6064 __tmp.put_u8(self.number_modes);
6065 __tmp.put_u8(self.mode_index);
6066 __tmp.put_u8(self.standard_mode as u8);
6067 for val in &self.mode_name {
6068 __tmp.put_u8(*val);
6069 }
6070 if matches!(version, MavlinkVersion::V2) {
6071 let len = __tmp.len();
6072 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6073 } else {
6074 __tmp.len()
6075 }
6076 }
6077}
6078#[doc = "id: 437"]
6079#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6080#[derive(Debug, Clone, PartialEq)]
6081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6083pub struct AVAILABLE_MODES_MONITOR_DATA {
6084 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6085 pub seq: u8,
6086}
6087impl AVAILABLE_MODES_MONITOR_DATA {
6088 pub const ENCODED_LEN: usize = 1usize;
6089 pub const DEFAULT: Self = Self { seq: 0_u8 };
6090 #[cfg(feature = "arbitrary")]
6091 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6092 use arbitrary::{Arbitrary, Unstructured};
6093 let mut buf = [0u8; 1024];
6094 rng.fill_bytes(&mut buf);
6095 let mut unstructured = Unstructured::new(&buf);
6096 Self::arbitrary(&mut unstructured).unwrap_or_default()
6097 }
6098}
6099impl Default for AVAILABLE_MODES_MONITOR_DATA {
6100 fn default() -> Self {
6101 Self::DEFAULT.clone()
6102 }
6103}
6104impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6105 type Message = MavMessage;
6106 const ID: u32 = 437u32;
6107 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6108 const EXTRA_CRC: u8 = 30u8;
6109 const ENCODED_LEN: usize = 1usize;
6110 fn deser(
6111 _version: MavlinkVersion,
6112 __input: &[u8],
6113 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6114 let avail_len = __input.len();
6115 let mut payload_buf = [0; Self::ENCODED_LEN];
6116 let mut buf = if avail_len < Self::ENCODED_LEN {
6117 payload_buf[0..avail_len].copy_from_slice(__input);
6118 Bytes::new(&payload_buf)
6119 } else {
6120 Bytes::new(__input)
6121 };
6122 let mut __struct = Self::default();
6123 __struct.seq = buf.get_u8();
6124 Ok(__struct)
6125 }
6126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6127 let mut __tmp = BytesMut::new(bytes);
6128 #[allow(clippy::absurd_extreme_comparisons)]
6129 #[allow(unused_comparisons)]
6130 if __tmp.remaining() < Self::ENCODED_LEN {
6131 panic!(
6132 "buffer is too small (need {} bytes, but got {})",
6133 Self::ENCODED_LEN,
6134 __tmp.remaining(),
6135 )
6136 }
6137 __tmp.put_u8(self.seq);
6138 if matches!(version, MavlinkVersion::V2) {
6139 let len = __tmp.len();
6140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6141 } else {
6142 __tmp.len()
6143 }
6144 }
6145}
6146#[doc = "id: 372"]
6147#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6148#[derive(Debug, Clone, PartialEq)]
6149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6151pub struct BATTERY_INFO_DATA {
6152 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6153 pub discharge_minimum_voltage: f32,
6154 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6155 pub charging_minimum_voltage: f32,
6156 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6157 pub resting_minimum_voltage: f32,
6158 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6159 pub charging_maximum_voltage: f32,
6160 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6161 pub charging_maximum_current: f32,
6162 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6163 pub nominal_voltage: f32,
6164 #[doc = "Maximum pack discharge current. 0: field not provided."]
6165 pub discharge_maximum_current: f32,
6166 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6167 pub discharge_maximum_burst_current: f32,
6168 #[doc = "Fully charged design capacity. 0: field not provided."]
6169 pub design_capacity: f32,
6170 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6171 pub full_charge_capacity: f32,
6172 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6173 pub cycle_count: u16,
6174 #[doc = "Battery weight. 0: field not provided."]
6175 pub weight: u16,
6176 #[doc = "Battery ID"]
6177 pub id: u8,
6178 #[doc = "Function of the battery."]
6179 pub battery_function: MavBatteryFunction,
6180 #[doc = "Type (chemistry) of the battery."]
6181 pub mavtype: MavBatteryType,
6182 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6183 pub state_of_health: u8,
6184 #[doc = "Number of battery cells in series. 0: field not provided."]
6185 pub cells_in_series: u8,
6186 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6187 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6188 pub manufacture_date: [u8; 9],
6189 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6190 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6191 pub serial_number: [u8; 32],
6192 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6193 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6194 pub name: [u8; 50],
6195}
6196impl BATTERY_INFO_DATA {
6197 pub const ENCODED_LEN: usize = 140usize;
6198 pub const DEFAULT: Self = Self {
6199 discharge_minimum_voltage: 0.0_f32,
6200 charging_minimum_voltage: 0.0_f32,
6201 resting_minimum_voltage: 0.0_f32,
6202 charging_maximum_voltage: 0.0_f32,
6203 charging_maximum_current: 0.0_f32,
6204 nominal_voltage: 0.0_f32,
6205 discharge_maximum_current: 0.0_f32,
6206 discharge_maximum_burst_current: 0.0_f32,
6207 design_capacity: 0.0_f32,
6208 full_charge_capacity: 0.0_f32,
6209 cycle_count: 0_u16,
6210 weight: 0_u16,
6211 id: 0_u8,
6212 battery_function: MavBatteryFunction::DEFAULT,
6213 mavtype: MavBatteryType::DEFAULT,
6214 state_of_health: 0_u8,
6215 cells_in_series: 0_u8,
6216 manufacture_date: [0_u8; 9usize],
6217 serial_number: [0_u8; 32usize],
6218 name: [0_u8; 50usize],
6219 };
6220 #[cfg(feature = "arbitrary")]
6221 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6222 use arbitrary::{Arbitrary, Unstructured};
6223 let mut buf = [0u8; 1024];
6224 rng.fill_bytes(&mut buf);
6225 let mut unstructured = Unstructured::new(&buf);
6226 Self::arbitrary(&mut unstructured).unwrap_or_default()
6227 }
6228}
6229impl Default for BATTERY_INFO_DATA {
6230 fn default() -> Self {
6231 Self::DEFAULT.clone()
6232 }
6233}
6234impl MessageData for BATTERY_INFO_DATA {
6235 type Message = MavMessage;
6236 const ID: u32 = 372u32;
6237 const NAME: &'static str = "BATTERY_INFO";
6238 const EXTRA_CRC: u8 = 26u8;
6239 const ENCODED_LEN: usize = 140usize;
6240 fn deser(
6241 _version: MavlinkVersion,
6242 __input: &[u8],
6243 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6244 let avail_len = __input.len();
6245 let mut payload_buf = [0; Self::ENCODED_LEN];
6246 let mut buf = if avail_len < Self::ENCODED_LEN {
6247 payload_buf[0..avail_len].copy_from_slice(__input);
6248 Bytes::new(&payload_buf)
6249 } else {
6250 Bytes::new(__input)
6251 };
6252 let mut __struct = Self::default();
6253 __struct.discharge_minimum_voltage = buf.get_f32_le();
6254 __struct.charging_minimum_voltage = buf.get_f32_le();
6255 __struct.resting_minimum_voltage = buf.get_f32_le();
6256 __struct.charging_maximum_voltage = buf.get_f32_le();
6257 __struct.charging_maximum_current = buf.get_f32_le();
6258 __struct.nominal_voltage = buf.get_f32_le();
6259 __struct.discharge_maximum_current = buf.get_f32_le();
6260 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6261 __struct.design_capacity = buf.get_f32_le();
6262 __struct.full_charge_capacity = buf.get_f32_le();
6263 __struct.cycle_count = buf.get_u16_le();
6264 __struct.weight = buf.get_u16_le();
6265 __struct.id = buf.get_u8();
6266 let tmp = buf.get_u8();
6267 __struct.battery_function =
6268 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6269 enum_type: "MavBatteryFunction",
6270 value: tmp as u32,
6271 })?;
6272 let tmp = buf.get_u8();
6273 __struct.mavtype =
6274 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6275 enum_type: "MavBatteryType",
6276 value: tmp as u32,
6277 })?;
6278 __struct.state_of_health = buf.get_u8();
6279 __struct.cells_in_series = buf.get_u8();
6280 for v in &mut __struct.manufacture_date {
6281 let val = buf.get_u8();
6282 *v = val;
6283 }
6284 for v in &mut __struct.serial_number {
6285 let val = buf.get_u8();
6286 *v = val;
6287 }
6288 for v in &mut __struct.name {
6289 let val = buf.get_u8();
6290 *v = val;
6291 }
6292 Ok(__struct)
6293 }
6294 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6295 let mut __tmp = BytesMut::new(bytes);
6296 #[allow(clippy::absurd_extreme_comparisons)]
6297 #[allow(unused_comparisons)]
6298 if __tmp.remaining() < Self::ENCODED_LEN {
6299 panic!(
6300 "buffer is too small (need {} bytes, but got {})",
6301 Self::ENCODED_LEN,
6302 __tmp.remaining(),
6303 )
6304 }
6305 __tmp.put_f32_le(self.discharge_minimum_voltage);
6306 __tmp.put_f32_le(self.charging_minimum_voltage);
6307 __tmp.put_f32_le(self.resting_minimum_voltage);
6308 __tmp.put_f32_le(self.charging_maximum_voltage);
6309 __tmp.put_f32_le(self.charging_maximum_current);
6310 __tmp.put_f32_le(self.nominal_voltage);
6311 __tmp.put_f32_le(self.discharge_maximum_current);
6312 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6313 __tmp.put_f32_le(self.design_capacity);
6314 __tmp.put_f32_le(self.full_charge_capacity);
6315 __tmp.put_u16_le(self.cycle_count);
6316 __tmp.put_u16_le(self.weight);
6317 __tmp.put_u8(self.id);
6318 __tmp.put_u8(self.battery_function as u8);
6319 __tmp.put_u8(self.mavtype as u8);
6320 __tmp.put_u8(self.state_of_health);
6321 __tmp.put_u8(self.cells_in_series);
6322 for val in &self.manufacture_date {
6323 __tmp.put_u8(*val);
6324 }
6325 for val in &self.serial_number {
6326 __tmp.put_u8(*val);
6327 }
6328 for val in &self.name {
6329 __tmp.put_u8(*val);
6330 }
6331 if matches!(version, MavlinkVersion::V2) {
6332 let len = __tmp.len();
6333 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6334 } else {
6335 __tmp.len()
6336 }
6337 }
6338}
6339#[doc = "id: 147"]
6340#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6341#[derive(Debug, Clone, PartialEq)]
6342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6344pub struct BATTERY_STATUS_DATA {
6345 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6346 pub current_consumed: i32,
6347 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6348 pub energy_consumed: i32,
6349 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6350 pub temperature: i16,
6351 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6352 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6353 pub voltages: [u16; 10],
6354 #[doc = "Battery current, -1: autopilot does not measure the current"]
6355 pub current_battery: i16,
6356 #[doc = "Battery ID"]
6357 pub id: u8,
6358 #[doc = "Function of the battery"]
6359 pub battery_function: MavBatteryFunction,
6360 #[doc = "Type (chemistry) of the battery"]
6361 pub mavtype: MavBatteryType,
6362 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6363 pub battery_remaining: i8,
6364 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6365 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6366 pub time_remaining: i32,
6367 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6368 #[cfg_attr(feature = "serde", serde(default))]
6369 pub charge_state: MavBatteryChargeState,
6370 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6371 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6372 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6373 pub voltages_ext: [u16; 4],
6374 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6375 #[cfg_attr(feature = "serde", serde(default))]
6376 pub mode: MavBatteryMode,
6377 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6378 #[cfg_attr(feature = "serde", serde(default))]
6379 pub fault_bitmask: MavBatteryFault,
6380}
6381impl BATTERY_STATUS_DATA {
6382 pub const ENCODED_LEN: usize = 54usize;
6383 pub const DEFAULT: Self = Self {
6384 current_consumed: 0_i32,
6385 energy_consumed: 0_i32,
6386 temperature: 0_i16,
6387 voltages: [0_u16; 10usize],
6388 current_battery: 0_i16,
6389 id: 0_u8,
6390 battery_function: MavBatteryFunction::DEFAULT,
6391 mavtype: MavBatteryType::DEFAULT,
6392 battery_remaining: 0_i8,
6393 time_remaining: 0_i32,
6394 charge_state: MavBatteryChargeState::DEFAULT,
6395 voltages_ext: [0_u16; 4usize],
6396 mode: MavBatteryMode::DEFAULT,
6397 fault_bitmask: MavBatteryFault::DEFAULT,
6398 };
6399 #[cfg(feature = "arbitrary")]
6400 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6401 use arbitrary::{Arbitrary, Unstructured};
6402 let mut buf = [0u8; 1024];
6403 rng.fill_bytes(&mut buf);
6404 let mut unstructured = Unstructured::new(&buf);
6405 Self::arbitrary(&mut unstructured).unwrap_or_default()
6406 }
6407}
6408impl Default for BATTERY_STATUS_DATA {
6409 fn default() -> Self {
6410 Self::DEFAULT.clone()
6411 }
6412}
6413impl MessageData for BATTERY_STATUS_DATA {
6414 type Message = MavMessage;
6415 const ID: u32 = 147u32;
6416 const NAME: &'static str = "BATTERY_STATUS";
6417 const EXTRA_CRC: u8 = 154u8;
6418 const ENCODED_LEN: usize = 54usize;
6419 fn deser(
6420 _version: MavlinkVersion,
6421 __input: &[u8],
6422 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6423 let avail_len = __input.len();
6424 let mut payload_buf = [0; Self::ENCODED_LEN];
6425 let mut buf = if avail_len < Self::ENCODED_LEN {
6426 payload_buf[0..avail_len].copy_from_slice(__input);
6427 Bytes::new(&payload_buf)
6428 } else {
6429 Bytes::new(__input)
6430 };
6431 let mut __struct = Self::default();
6432 __struct.current_consumed = buf.get_i32_le();
6433 __struct.energy_consumed = buf.get_i32_le();
6434 __struct.temperature = buf.get_i16_le();
6435 for v in &mut __struct.voltages {
6436 let val = buf.get_u16_le();
6437 *v = val;
6438 }
6439 __struct.current_battery = buf.get_i16_le();
6440 __struct.id = buf.get_u8();
6441 let tmp = buf.get_u8();
6442 __struct.battery_function =
6443 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6444 enum_type: "MavBatteryFunction",
6445 value: tmp as u32,
6446 })?;
6447 let tmp = buf.get_u8();
6448 __struct.mavtype =
6449 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6450 enum_type: "MavBatteryType",
6451 value: tmp as u32,
6452 })?;
6453 __struct.battery_remaining = buf.get_i8();
6454 __struct.time_remaining = buf.get_i32_le();
6455 let tmp = buf.get_u8();
6456 __struct.charge_state =
6457 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6458 enum_type: "MavBatteryChargeState",
6459 value: tmp as u32,
6460 })?;
6461 for v in &mut __struct.voltages_ext {
6462 let val = buf.get_u16_le();
6463 *v = val;
6464 }
6465 let tmp = buf.get_u8();
6466 __struct.mode =
6467 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6468 enum_type: "MavBatteryMode",
6469 value: tmp as u32,
6470 })?;
6471 let tmp = buf.get_u32_le();
6472 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6473 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6474 flag_type: "MavBatteryFault",
6475 value: tmp as u32,
6476 })?;
6477 Ok(__struct)
6478 }
6479 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6480 let mut __tmp = BytesMut::new(bytes);
6481 #[allow(clippy::absurd_extreme_comparisons)]
6482 #[allow(unused_comparisons)]
6483 if __tmp.remaining() < Self::ENCODED_LEN {
6484 panic!(
6485 "buffer is too small (need {} bytes, but got {})",
6486 Self::ENCODED_LEN,
6487 __tmp.remaining(),
6488 )
6489 }
6490 __tmp.put_i32_le(self.current_consumed);
6491 __tmp.put_i32_le(self.energy_consumed);
6492 __tmp.put_i16_le(self.temperature);
6493 for val in &self.voltages {
6494 __tmp.put_u16_le(*val);
6495 }
6496 __tmp.put_i16_le(self.current_battery);
6497 __tmp.put_u8(self.id);
6498 __tmp.put_u8(self.battery_function as u8);
6499 __tmp.put_u8(self.mavtype as u8);
6500 __tmp.put_i8(self.battery_remaining);
6501 __tmp.put_i32_le(self.time_remaining);
6502 __tmp.put_u8(self.charge_state as u8);
6503 for val in &self.voltages_ext {
6504 __tmp.put_u16_le(*val);
6505 }
6506 __tmp.put_u8(self.mode as u8);
6507 __tmp.put_u32_le(self.fault_bitmask.bits());
6508 if matches!(version, MavlinkVersion::V2) {
6509 let len = __tmp.len();
6510 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6511 } else {
6512 __tmp.len()
6513 }
6514 }
6515}
6516#[doc = "id: 257"]
6517#[doc = "Report button state change."]
6518#[derive(Debug, Clone, PartialEq)]
6519#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6520#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6521pub struct BUTTON_CHANGE_DATA {
6522 #[doc = "Timestamp (time since system boot)."]
6523 pub time_boot_ms: u32,
6524 #[doc = "Time of last change of button state."]
6525 pub last_change_ms: u32,
6526 #[doc = "Bitmap for state of buttons."]
6527 pub state: u8,
6528}
6529impl BUTTON_CHANGE_DATA {
6530 pub const ENCODED_LEN: usize = 9usize;
6531 pub const DEFAULT: Self = Self {
6532 time_boot_ms: 0_u32,
6533 last_change_ms: 0_u32,
6534 state: 0_u8,
6535 };
6536 #[cfg(feature = "arbitrary")]
6537 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6538 use arbitrary::{Arbitrary, Unstructured};
6539 let mut buf = [0u8; 1024];
6540 rng.fill_bytes(&mut buf);
6541 let mut unstructured = Unstructured::new(&buf);
6542 Self::arbitrary(&mut unstructured).unwrap_or_default()
6543 }
6544}
6545impl Default for BUTTON_CHANGE_DATA {
6546 fn default() -> Self {
6547 Self::DEFAULT.clone()
6548 }
6549}
6550impl MessageData for BUTTON_CHANGE_DATA {
6551 type Message = MavMessage;
6552 const ID: u32 = 257u32;
6553 const NAME: &'static str = "BUTTON_CHANGE";
6554 const EXTRA_CRC: u8 = 131u8;
6555 const ENCODED_LEN: usize = 9usize;
6556 fn deser(
6557 _version: MavlinkVersion,
6558 __input: &[u8],
6559 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6560 let avail_len = __input.len();
6561 let mut payload_buf = [0; Self::ENCODED_LEN];
6562 let mut buf = if avail_len < Self::ENCODED_LEN {
6563 payload_buf[0..avail_len].copy_from_slice(__input);
6564 Bytes::new(&payload_buf)
6565 } else {
6566 Bytes::new(__input)
6567 };
6568 let mut __struct = Self::default();
6569 __struct.time_boot_ms = buf.get_u32_le();
6570 __struct.last_change_ms = buf.get_u32_le();
6571 __struct.state = buf.get_u8();
6572 Ok(__struct)
6573 }
6574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6575 let mut __tmp = BytesMut::new(bytes);
6576 #[allow(clippy::absurd_extreme_comparisons)]
6577 #[allow(unused_comparisons)]
6578 if __tmp.remaining() < Self::ENCODED_LEN {
6579 panic!(
6580 "buffer is too small (need {} bytes, but got {})",
6581 Self::ENCODED_LEN,
6582 __tmp.remaining(),
6583 )
6584 }
6585 __tmp.put_u32_le(self.time_boot_ms);
6586 __tmp.put_u32_le(self.last_change_ms);
6587 __tmp.put_u8(self.state);
6588 if matches!(version, MavlinkVersion::V2) {
6589 let len = __tmp.len();
6590 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6591 } else {
6592 __tmp.len()
6593 }
6594 }
6595}
6596#[doc = "id: 262"]
6597#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6598#[derive(Debug, Clone, PartialEq)]
6599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6601pub struct CAMERA_CAPTURE_STATUS_DATA {
6602 #[doc = "Timestamp (time since system boot)."]
6603 pub time_boot_ms: u32,
6604 #[doc = "Image capture interval"]
6605 pub image_interval: f32,
6606 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6607 pub recording_time_ms: u32,
6608 #[doc = "Available storage capacity."]
6609 pub available_capacity: f32,
6610 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6611 pub image_status: u8,
6612 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6613 pub video_status: u8,
6614 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6615 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6616 pub image_count: i32,
6617 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6618 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6619 pub camera_device_id: u8,
6620}
6621impl CAMERA_CAPTURE_STATUS_DATA {
6622 pub const ENCODED_LEN: usize = 23usize;
6623 pub const DEFAULT: Self = Self {
6624 time_boot_ms: 0_u32,
6625 image_interval: 0.0_f32,
6626 recording_time_ms: 0_u32,
6627 available_capacity: 0.0_f32,
6628 image_status: 0_u8,
6629 video_status: 0_u8,
6630 image_count: 0_i32,
6631 camera_device_id: 0_u8,
6632 };
6633 #[cfg(feature = "arbitrary")]
6634 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6635 use arbitrary::{Arbitrary, Unstructured};
6636 let mut buf = [0u8; 1024];
6637 rng.fill_bytes(&mut buf);
6638 let mut unstructured = Unstructured::new(&buf);
6639 Self::arbitrary(&mut unstructured).unwrap_or_default()
6640 }
6641}
6642impl Default for CAMERA_CAPTURE_STATUS_DATA {
6643 fn default() -> Self {
6644 Self::DEFAULT.clone()
6645 }
6646}
6647impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6648 type Message = MavMessage;
6649 const ID: u32 = 262u32;
6650 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6651 const EXTRA_CRC: u8 = 12u8;
6652 const ENCODED_LEN: usize = 23usize;
6653 fn deser(
6654 _version: MavlinkVersion,
6655 __input: &[u8],
6656 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6657 let avail_len = __input.len();
6658 let mut payload_buf = [0; Self::ENCODED_LEN];
6659 let mut buf = if avail_len < Self::ENCODED_LEN {
6660 payload_buf[0..avail_len].copy_from_slice(__input);
6661 Bytes::new(&payload_buf)
6662 } else {
6663 Bytes::new(__input)
6664 };
6665 let mut __struct = Self::default();
6666 __struct.time_boot_ms = buf.get_u32_le();
6667 __struct.image_interval = buf.get_f32_le();
6668 __struct.recording_time_ms = buf.get_u32_le();
6669 __struct.available_capacity = buf.get_f32_le();
6670 __struct.image_status = buf.get_u8();
6671 __struct.video_status = buf.get_u8();
6672 __struct.image_count = buf.get_i32_le();
6673 __struct.camera_device_id = buf.get_u8();
6674 Ok(__struct)
6675 }
6676 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6677 let mut __tmp = BytesMut::new(bytes);
6678 #[allow(clippy::absurd_extreme_comparisons)]
6679 #[allow(unused_comparisons)]
6680 if __tmp.remaining() < Self::ENCODED_LEN {
6681 panic!(
6682 "buffer is too small (need {} bytes, but got {})",
6683 Self::ENCODED_LEN,
6684 __tmp.remaining(),
6685 )
6686 }
6687 __tmp.put_u32_le(self.time_boot_ms);
6688 __tmp.put_f32_le(self.image_interval);
6689 __tmp.put_u32_le(self.recording_time_ms);
6690 __tmp.put_f32_le(self.available_capacity);
6691 __tmp.put_u8(self.image_status);
6692 __tmp.put_u8(self.video_status);
6693 __tmp.put_i32_le(self.image_count);
6694 __tmp.put_u8(self.camera_device_id);
6695 if matches!(version, MavlinkVersion::V2) {
6696 let len = __tmp.len();
6697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6698 } else {
6699 __tmp.len()
6700 }
6701 }
6702}
6703#[doc = "id: 271"]
6704#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6705#[derive(Debug, Clone, PartialEq)]
6706#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6707#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6708pub struct CAMERA_FOV_STATUS_DATA {
6709 #[doc = "Timestamp (time since system boot)."]
6710 pub time_boot_ms: u32,
6711 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
6712 pub lat_camera: i32,
6713 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
6714 pub lon_camera: i32,
6715 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
6716 pub alt_camera: i32,
6717 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6718 pub lat_image: i32,
6719 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6720 pub lon_image: i32,
6721 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6722 pub alt_image: i32,
6723 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6724 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6725 pub q: [f32; 4],
6726 #[doc = "Horizontal field of view (NaN if unknown)."]
6727 pub hfov: f32,
6728 #[doc = "Vertical field of view (NaN if unknown)."]
6729 pub vfov: f32,
6730 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6731 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6732 pub camera_device_id: u8,
6733}
6734impl CAMERA_FOV_STATUS_DATA {
6735 pub const ENCODED_LEN: usize = 53usize;
6736 pub const DEFAULT: Self = Self {
6737 time_boot_ms: 0_u32,
6738 lat_camera: 0_i32,
6739 lon_camera: 0_i32,
6740 alt_camera: 0_i32,
6741 lat_image: 0_i32,
6742 lon_image: 0_i32,
6743 alt_image: 0_i32,
6744 q: [0.0_f32; 4usize],
6745 hfov: 0.0_f32,
6746 vfov: 0.0_f32,
6747 camera_device_id: 0_u8,
6748 };
6749 #[cfg(feature = "arbitrary")]
6750 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6751 use arbitrary::{Arbitrary, Unstructured};
6752 let mut buf = [0u8; 1024];
6753 rng.fill_bytes(&mut buf);
6754 let mut unstructured = Unstructured::new(&buf);
6755 Self::arbitrary(&mut unstructured).unwrap_or_default()
6756 }
6757}
6758impl Default for CAMERA_FOV_STATUS_DATA {
6759 fn default() -> Self {
6760 Self::DEFAULT.clone()
6761 }
6762}
6763impl MessageData for CAMERA_FOV_STATUS_DATA {
6764 type Message = MavMessage;
6765 const ID: u32 = 271u32;
6766 const NAME: &'static str = "CAMERA_FOV_STATUS";
6767 const EXTRA_CRC: u8 = 22u8;
6768 const ENCODED_LEN: usize = 53usize;
6769 fn deser(
6770 _version: MavlinkVersion,
6771 __input: &[u8],
6772 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6773 let avail_len = __input.len();
6774 let mut payload_buf = [0; Self::ENCODED_LEN];
6775 let mut buf = if avail_len < Self::ENCODED_LEN {
6776 payload_buf[0..avail_len].copy_from_slice(__input);
6777 Bytes::new(&payload_buf)
6778 } else {
6779 Bytes::new(__input)
6780 };
6781 let mut __struct = Self::default();
6782 __struct.time_boot_ms = buf.get_u32_le();
6783 __struct.lat_camera = buf.get_i32_le();
6784 __struct.lon_camera = buf.get_i32_le();
6785 __struct.alt_camera = buf.get_i32_le();
6786 __struct.lat_image = buf.get_i32_le();
6787 __struct.lon_image = buf.get_i32_le();
6788 __struct.alt_image = buf.get_i32_le();
6789 for v in &mut __struct.q {
6790 let val = buf.get_f32_le();
6791 *v = val;
6792 }
6793 __struct.hfov = buf.get_f32_le();
6794 __struct.vfov = buf.get_f32_le();
6795 __struct.camera_device_id = buf.get_u8();
6796 Ok(__struct)
6797 }
6798 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6799 let mut __tmp = BytesMut::new(bytes);
6800 #[allow(clippy::absurd_extreme_comparisons)]
6801 #[allow(unused_comparisons)]
6802 if __tmp.remaining() < Self::ENCODED_LEN {
6803 panic!(
6804 "buffer is too small (need {} bytes, but got {})",
6805 Self::ENCODED_LEN,
6806 __tmp.remaining(),
6807 )
6808 }
6809 __tmp.put_u32_le(self.time_boot_ms);
6810 __tmp.put_i32_le(self.lat_camera);
6811 __tmp.put_i32_le(self.lon_camera);
6812 __tmp.put_i32_le(self.alt_camera);
6813 __tmp.put_i32_le(self.lat_image);
6814 __tmp.put_i32_le(self.lon_image);
6815 __tmp.put_i32_le(self.alt_image);
6816 for val in &self.q {
6817 __tmp.put_f32_le(*val);
6818 }
6819 __tmp.put_f32_le(self.hfov);
6820 __tmp.put_f32_le(self.vfov);
6821 __tmp.put_u8(self.camera_device_id);
6822 if matches!(version, MavlinkVersion::V2) {
6823 let len = __tmp.len();
6824 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6825 } else {
6826 __tmp.len()
6827 }
6828 }
6829}
6830#[doc = "id: 263"]
6831#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
6832#[derive(Debug, Clone, PartialEq)]
6833#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6834#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6835pub struct CAMERA_IMAGE_CAPTURED_DATA {
6836 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
6837 pub time_utc: u64,
6838 #[doc = "Timestamp (time since system boot)."]
6839 pub time_boot_ms: u32,
6840 #[doc = "Latitude where image was taken"]
6841 pub lat: i32,
6842 #[doc = "Longitude where capture was taken"]
6843 pub lon: i32,
6844 #[doc = "Altitude (MSL) where image was taken"]
6845 pub alt: i32,
6846 #[doc = "Altitude above ground"]
6847 pub relative_alt: i32,
6848 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6849 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6850 pub q: [f32; 4],
6851 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
6852 pub image_index: i32,
6853 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
6854 pub camera_id: u8,
6855 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
6856 pub capture_result: i8,
6857 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
6858 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6859 pub file_url: [u8; 205],
6860}
6861impl CAMERA_IMAGE_CAPTURED_DATA {
6862 pub const ENCODED_LEN: usize = 255usize;
6863 pub const DEFAULT: Self = Self {
6864 time_utc: 0_u64,
6865 time_boot_ms: 0_u32,
6866 lat: 0_i32,
6867 lon: 0_i32,
6868 alt: 0_i32,
6869 relative_alt: 0_i32,
6870 q: [0.0_f32; 4usize],
6871 image_index: 0_i32,
6872 camera_id: 0_u8,
6873 capture_result: 0_i8,
6874 file_url: [0_u8; 205usize],
6875 };
6876 #[cfg(feature = "arbitrary")]
6877 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6878 use arbitrary::{Arbitrary, Unstructured};
6879 let mut buf = [0u8; 1024];
6880 rng.fill_bytes(&mut buf);
6881 let mut unstructured = Unstructured::new(&buf);
6882 Self::arbitrary(&mut unstructured).unwrap_or_default()
6883 }
6884}
6885impl Default for CAMERA_IMAGE_CAPTURED_DATA {
6886 fn default() -> Self {
6887 Self::DEFAULT.clone()
6888 }
6889}
6890impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
6891 type Message = MavMessage;
6892 const ID: u32 = 263u32;
6893 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
6894 const EXTRA_CRC: u8 = 133u8;
6895 const ENCODED_LEN: usize = 255usize;
6896 fn deser(
6897 _version: MavlinkVersion,
6898 __input: &[u8],
6899 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6900 let avail_len = __input.len();
6901 let mut payload_buf = [0; Self::ENCODED_LEN];
6902 let mut buf = if avail_len < Self::ENCODED_LEN {
6903 payload_buf[0..avail_len].copy_from_slice(__input);
6904 Bytes::new(&payload_buf)
6905 } else {
6906 Bytes::new(__input)
6907 };
6908 let mut __struct = Self::default();
6909 __struct.time_utc = buf.get_u64_le();
6910 __struct.time_boot_ms = buf.get_u32_le();
6911 __struct.lat = buf.get_i32_le();
6912 __struct.lon = buf.get_i32_le();
6913 __struct.alt = buf.get_i32_le();
6914 __struct.relative_alt = buf.get_i32_le();
6915 for v in &mut __struct.q {
6916 let val = buf.get_f32_le();
6917 *v = val;
6918 }
6919 __struct.image_index = buf.get_i32_le();
6920 __struct.camera_id = buf.get_u8();
6921 __struct.capture_result = buf.get_i8();
6922 for v in &mut __struct.file_url {
6923 let val = buf.get_u8();
6924 *v = val;
6925 }
6926 Ok(__struct)
6927 }
6928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6929 let mut __tmp = BytesMut::new(bytes);
6930 #[allow(clippy::absurd_extreme_comparisons)]
6931 #[allow(unused_comparisons)]
6932 if __tmp.remaining() < Self::ENCODED_LEN {
6933 panic!(
6934 "buffer is too small (need {} bytes, but got {})",
6935 Self::ENCODED_LEN,
6936 __tmp.remaining(),
6937 )
6938 }
6939 __tmp.put_u64_le(self.time_utc);
6940 __tmp.put_u32_le(self.time_boot_ms);
6941 __tmp.put_i32_le(self.lat);
6942 __tmp.put_i32_le(self.lon);
6943 __tmp.put_i32_le(self.alt);
6944 __tmp.put_i32_le(self.relative_alt);
6945 for val in &self.q {
6946 __tmp.put_f32_le(*val);
6947 }
6948 __tmp.put_i32_le(self.image_index);
6949 __tmp.put_u8(self.camera_id);
6950 __tmp.put_i8(self.capture_result);
6951 for val in &self.file_url {
6952 __tmp.put_u8(*val);
6953 }
6954 if matches!(version, MavlinkVersion::V2) {
6955 let len = __tmp.len();
6956 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6957 } else {
6958 __tmp.len()
6959 }
6960 }
6961}
6962#[doc = "id: 259"]
6963#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6964#[derive(Debug, Clone, PartialEq)]
6965#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6966#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6967pub struct CAMERA_INFORMATION_DATA {
6968 #[doc = "Timestamp (time since system boot)."]
6969 pub time_boot_ms: u32,
6970 #[doc = "0xff). Use 0 if not known."]
6971 pub firmware_version: u32,
6972 #[doc = "Focal length. Use NaN if not known."]
6973 pub focal_length: f32,
6974 #[doc = "Image sensor size horizontal. Use NaN if not known."]
6975 pub sensor_size_h: f32,
6976 #[doc = "Image sensor size vertical. Use NaN if not known."]
6977 pub sensor_size_v: f32,
6978 #[doc = "Bitmap of camera capability flags."]
6979 pub flags: CameraCapFlags,
6980 #[doc = "Horizontal image resolution. Use 0 if not known."]
6981 pub resolution_h: u16,
6982 #[doc = "Vertical image resolution. Use 0 if not known."]
6983 pub resolution_v: u16,
6984 #[doc = "Camera definition version (iteration). Use 0 if not known."]
6985 pub cam_definition_version: u16,
6986 #[doc = "Name of the camera vendor"]
6987 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6988 pub vendor_name: [u8; 32],
6989 #[doc = "Name of the camera model"]
6990 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6991 pub model_name: [u8; 32],
6992 #[doc = "Reserved for a lens ID. Use 0 if not known."]
6993 pub lens_id: u8,
6994 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
6995 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6996 pub cam_definition_uri: [u8; 140],
6997 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
6998 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6999 pub gimbal_device_id: u8,
7000 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7001 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7002 pub camera_device_id: u8,
7003}
7004impl CAMERA_INFORMATION_DATA {
7005 pub const ENCODED_LEN: usize = 237usize;
7006 pub const DEFAULT: Self = Self {
7007 time_boot_ms: 0_u32,
7008 firmware_version: 0_u32,
7009 focal_length: 0.0_f32,
7010 sensor_size_h: 0.0_f32,
7011 sensor_size_v: 0.0_f32,
7012 flags: CameraCapFlags::DEFAULT,
7013 resolution_h: 0_u16,
7014 resolution_v: 0_u16,
7015 cam_definition_version: 0_u16,
7016 vendor_name: [0_u8; 32usize],
7017 model_name: [0_u8; 32usize],
7018 lens_id: 0_u8,
7019 cam_definition_uri: [0_u8; 140usize],
7020 gimbal_device_id: 0_u8,
7021 camera_device_id: 0_u8,
7022 };
7023 #[cfg(feature = "arbitrary")]
7024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7025 use arbitrary::{Arbitrary, Unstructured};
7026 let mut buf = [0u8; 1024];
7027 rng.fill_bytes(&mut buf);
7028 let mut unstructured = Unstructured::new(&buf);
7029 Self::arbitrary(&mut unstructured).unwrap_or_default()
7030 }
7031}
7032impl Default for CAMERA_INFORMATION_DATA {
7033 fn default() -> Self {
7034 Self::DEFAULT.clone()
7035 }
7036}
7037impl MessageData for CAMERA_INFORMATION_DATA {
7038 type Message = MavMessage;
7039 const ID: u32 = 259u32;
7040 const NAME: &'static str = "CAMERA_INFORMATION";
7041 const EXTRA_CRC: u8 = 92u8;
7042 const ENCODED_LEN: usize = 237usize;
7043 fn deser(
7044 _version: MavlinkVersion,
7045 __input: &[u8],
7046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7047 let avail_len = __input.len();
7048 let mut payload_buf = [0; Self::ENCODED_LEN];
7049 let mut buf = if avail_len < Self::ENCODED_LEN {
7050 payload_buf[0..avail_len].copy_from_slice(__input);
7051 Bytes::new(&payload_buf)
7052 } else {
7053 Bytes::new(__input)
7054 };
7055 let mut __struct = Self::default();
7056 __struct.time_boot_ms = buf.get_u32_le();
7057 __struct.firmware_version = buf.get_u32_le();
7058 __struct.focal_length = buf.get_f32_le();
7059 __struct.sensor_size_h = buf.get_f32_le();
7060 __struct.sensor_size_v = buf.get_f32_le();
7061 let tmp = buf.get_u32_le();
7062 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7063 ::mavlink_core::error::ParserError::InvalidFlag {
7064 flag_type: "CameraCapFlags",
7065 value: tmp as u32,
7066 },
7067 )?;
7068 __struct.resolution_h = buf.get_u16_le();
7069 __struct.resolution_v = buf.get_u16_le();
7070 __struct.cam_definition_version = buf.get_u16_le();
7071 for v in &mut __struct.vendor_name {
7072 let val = buf.get_u8();
7073 *v = val;
7074 }
7075 for v in &mut __struct.model_name {
7076 let val = buf.get_u8();
7077 *v = val;
7078 }
7079 __struct.lens_id = buf.get_u8();
7080 for v in &mut __struct.cam_definition_uri {
7081 let val = buf.get_u8();
7082 *v = val;
7083 }
7084 __struct.gimbal_device_id = buf.get_u8();
7085 __struct.camera_device_id = buf.get_u8();
7086 Ok(__struct)
7087 }
7088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7089 let mut __tmp = BytesMut::new(bytes);
7090 #[allow(clippy::absurd_extreme_comparisons)]
7091 #[allow(unused_comparisons)]
7092 if __tmp.remaining() < Self::ENCODED_LEN {
7093 panic!(
7094 "buffer is too small (need {} bytes, but got {})",
7095 Self::ENCODED_LEN,
7096 __tmp.remaining(),
7097 )
7098 }
7099 __tmp.put_u32_le(self.time_boot_ms);
7100 __tmp.put_u32_le(self.firmware_version);
7101 __tmp.put_f32_le(self.focal_length);
7102 __tmp.put_f32_le(self.sensor_size_h);
7103 __tmp.put_f32_le(self.sensor_size_v);
7104 __tmp.put_u32_le(self.flags.bits());
7105 __tmp.put_u16_le(self.resolution_h);
7106 __tmp.put_u16_le(self.resolution_v);
7107 __tmp.put_u16_le(self.cam_definition_version);
7108 for val in &self.vendor_name {
7109 __tmp.put_u8(*val);
7110 }
7111 for val in &self.model_name {
7112 __tmp.put_u8(*val);
7113 }
7114 __tmp.put_u8(self.lens_id);
7115 for val in &self.cam_definition_uri {
7116 __tmp.put_u8(*val);
7117 }
7118 __tmp.put_u8(self.gimbal_device_id);
7119 __tmp.put_u8(self.camera_device_id);
7120 if matches!(version, MavlinkVersion::V2) {
7121 let len = __tmp.len();
7122 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7123 } else {
7124 __tmp.len()
7125 }
7126 }
7127}
7128#[doc = "id: 260"]
7129#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7130#[derive(Debug, Clone, PartialEq)]
7131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7133pub struct CAMERA_SETTINGS_DATA {
7134 #[doc = "Timestamp (time since system boot)."]
7135 pub time_boot_ms: u32,
7136 #[doc = "Camera mode"]
7137 pub mode_id: CameraMode,
7138 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7139 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7140 pub zoomLevel: f32,
7141 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7142 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7143 pub focusLevel: f32,
7144 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7145 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7146 pub camera_device_id: u8,
7147}
7148impl CAMERA_SETTINGS_DATA {
7149 pub const ENCODED_LEN: usize = 14usize;
7150 pub const DEFAULT: Self = Self {
7151 time_boot_ms: 0_u32,
7152 mode_id: CameraMode::DEFAULT,
7153 zoomLevel: 0.0_f32,
7154 focusLevel: 0.0_f32,
7155 camera_device_id: 0_u8,
7156 };
7157 #[cfg(feature = "arbitrary")]
7158 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7159 use arbitrary::{Arbitrary, Unstructured};
7160 let mut buf = [0u8; 1024];
7161 rng.fill_bytes(&mut buf);
7162 let mut unstructured = Unstructured::new(&buf);
7163 Self::arbitrary(&mut unstructured).unwrap_or_default()
7164 }
7165}
7166impl Default for CAMERA_SETTINGS_DATA {
7167 fn default() -> Self {
7168 Self::DEFAULT.clone()
7169 }
7170}
7171impl MessageData for CAMERA_SETTINGS_DATA {
7172 type Message = MavMessage;
7173 const ID: u32 = 260u32;
7174 const NAME: &'static str = "CAMERA_SETTINGS";
7175 const EXTRA_CRC: u8 = 146u8;
7176 const ENCODED_LEN: usize = 14usize;
7177 fn deser(
7178 _version: MavlinkVersion,
7179 __input: &[u8],
7180 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7181 let avail_len = __input.len();
7182 let mut payload_buf = [0; Self::ENCODED_LEN];
7183 let mut buf = if avail_len < Self::ENCODED_LEN {
7184 payload_buf[0..avail_len].copy_from_slice(__input);
7185 Bytes::new(&payload_buf)
7186 } else {
7187 Bytes::new(__input)
7188 };
7189 let mut __struct = Self::default();
7190 __struct.time_boot_ms = buf.get_u32_le();
7191 let tmp = buf.get_u8();
7192 __struct.mode_id =
7193 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7194 enum_type: "CameraMode",
7195 value: tmp as u32,
7196 })?;
7197 __struct.zoomLevel = buf.get_f32_le();
7198 __struct.focusLevel = buf.get_f32_le();
7199 __struct.camera_device_id = buf.get_u8();
7200 Ok(__struct)
7201 }
7202 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7203 let mut __tmp = BytesMut::new(bytes);
7204 #[allow(clippy::absurd_extreme_comparisons)]
7205 #[allow(unused_comparisons)]
7206 if __tmp.remaining() < Self::ENCODED_LEN {
7207 panic!(
7208 "buffer is too small (need {} bytes, but got {})",
7209 Self::ENCODED_LEN,
7210 __tmp.remaining(),
7211 )
7212 }
7213 __tmp.put_u32_le(self.time_boot_ms);
7214 __tmp.put_u8(self.mode_id as u8);
7215 __tmp.put_f32_le(self.zoomLevel);
7216 __tmp.put_f32_le(self.focusLevel);
7217 __tmp.put_u8(self.camera_device_id);
7218 if matches!(version, MavlinkVersion::V2) {
7219 let len = __tmp.len();
7220 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7221 } else {
7222 __tmp.len()
7223 }
7224 }
7225}
7226#[doc = "id: 277"]
7227#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7228#[derive(Debug, Clone, PartialEq)]
7229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7231pub struct CAMERA_THERMAL_RANGE_DATA {
7232 #[doc = "Timestamp (time since system boot)."]
7233 pub time_boot_ms: u32,
7234 #[doc = "Temperature max."]
7235 pub max: f32,
7236 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7237 pub max_point_x: f32,
7238 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7239 pub max_point_y: f32,
7240 #[doc = "Temperature min."]
7241 pub min: f32,
7242 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7243 pub min_point_x: f32,
7244 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7245 pub min_point_y: f32,
7246 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7247 pub stream_id: u8,
7248 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7249 pub camera_device_id: u8,
7250}
7251impl CAMERA_THERMAL_RANGE_DATA {
7252 pub const ENCODED_LEN: usize = 30usize;
7253 pub const DEFAULT: Self = Self {
7254 time_boot_ms: 0_u32,
7255 max: 0.0_f32,
7256 max_point_x: 0.0_f32,
7257 max_point_y: 0.0_f32,
7258 min: 0.0_f32,
7259 min_point_x: 0.0_f32,
7260 min_point_y: 0.0_f32,
7261 stream_id: 0_u8,
7262 camera_device_id: 0_u8,
7263 };
7264 #[cfg(feature = "arbitrary")]
7265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7266 use arbitrary::{Arbitrary, Unstructured};
7267 let mut buf = [0u8; 1024];
7268 rng.fill_bytes(&mut buf);
7269 let mut unstructured = Unstructured::new(&buf);
7270 Self::arbitrary(&mut unstructured).unwrap_or_default()
7271 }
7272}
7273impl Default for CAMERA_THERMAL_RANGE_DATA {
7274 fn default() -> Self {
7275 Self::DEFAULT.clone()
7276 }
7277}
7278impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7279 type Message = MavMessage;
7280 const ID: u32 = 277u32;
7281 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7282 const EXTRA_CRC: u8 = 62u8;
7283 const ENCODED_LEN: usize = 30usize;
7284 fn deser(
7285 _version: MavlinkVersion,
7286 __input: &[u8],
7287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7288 let avail_len = __input.len();
7289 let mut payload_buf = [0; Self::ENCODED_LEN];
7290 let mut buf = if avail_len < Self::ENCODED_LEN {
7291 payload_buf[0..avail_len].copy_from_slice(__input);
7292 Bytes::new(&payload_buf)
7293 } else {
7294 Bytes::new(__input)
7295 };
7296 let mut __struct = Self::default();
7297 __struct.time_boot_ms = buf.get_u32_le();
7298 __struct.max = buf.get_f32_le();
7299 __struct.max_point_x = buf.get_f32_le();
7300 __struct.max_point_y = buf.get_f32_le();
7301 __struct.min = buf.get_f32_le();
7302 __struct.min_point_x = buf.get_f32_le();
7303 __struct.min_point_y = buf.get_f32_le();
7304 __struct.stream_id = buf.get_u8();
7305 __struct.camera_device_id = buf.get_u8();
7306 Ok(__struct)
7307 }
7308 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7309 let mut __tmp = BytesMut::new(bytes);
7310 #[allow(clippy::absurd_extreme_comparisons)]
7311 #[allow(unused_comparisons)]
7312 if __tmp.remaining() < Self::ENCODED_LEN {
7313 panic!(
7314 "buffer is too small (need {} bytes, but got {})",
7315 Self::ENCODED_LEN,
7316 __tmp.remaining(),
7317 )
7318 }
7319 __tmp.put_u32_le(self.time_boot_ms);
7320 __tmp.put_f32_le(self.max);
7321 __tmp.put_f32_le(self.max_point_x);
7322 __tmp.put_f32_le(self.max_point_y);
7323 __tmp.put_f32_le(self.min);
7324 __tmp.put_f32_le(self.min_point_x);
7325 __tmp.put_f32_le(self.min_point_y);
7326 __tmp.put_u8(self.stream_id);
7327 __tmp.put_u8(self.camera_device_id);
7328 if matches!(version, MavlinkVersion::V2) {
7329 let len = __tmp.len();
7330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7331 } else {
7332 __tmp.len()
7333 }
7334 }
7335}
7336#[doc = "id: 276"]
7337#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7338#[derive(Debug, Clone, PartialEq)]
7339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7340#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7341pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7342 #[doc = "Latitude of tracked object"]
7343 pub lat: i32,
7344 #[doc = "Longitude of tracked object"]
7345 pub lon: i32,
7346 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7347 pub alt: f32,
7348 #[doc = "Horizontal accuracy. NAN if unknown"]
7349 pub h_acc: f32,
7350 #[doc = "Vertical accuracy. NAN if unknown"]
7351 pub v_acc: f32,
7352 #[doc = "North velocity of tracked object. NAN if unknown"]
7353 pub vel_n: f32,
7354 #[doc = "East velocity of tracked object. NAN if unknown"]
7355 pub vel_e: f32,
7356 #[doc = "Down velocity of tracked object. NAN if unknown"]
7357 pub vel_d: f32,
7358 #[doc = "Velocity accuracy. NAN if unknown"]
7359 pub vel_acc: f32,
7360 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7361 pub dist: f32,
7362 #[doc = "Heading in radians, in NED. NAN if unknown"]
7363 pub hdg: f32,
7364 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7365 pub hdg_acc: f32,
7366 #[doc = "Current tracking status"]
7367 pub tracking_status: CameraTrackingStatusFlags,
7368 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7369 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7370 pub camera_device_id: u8,
7371}
7372impl CAMERA_TRACKING_GEO_STATUS_DATA {
7373 pub const ENCODED_LEN: usize = 50usize;
7374 pub const DEFAULT: Self = Self {
7375 lat: 0_i32,
7376 lon: 0_i32,
7377 alt: 0.0_f32,
7378 h_acc: 0.0_f32,
7379 v_acc: 0.0_f32,
7380 vel_n: 0.0_f32,
7381 vel_e: 0.0_f32,
7382 vel_d: 0.0_f32,
7383 vel_acc: 0.0_f32,
7384 dist: 0.0_f32,
7385 hdg: 0.0_f32,
7386 hdg_acc: 0.0_f32,
7387 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7388 camera_device_id: 0_u8,
7389 };
7390 #[cfg(feature = "arbitrary")]
7391 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7392 use arbitrary::{Arbitrary, Unstructured};
7393 let mut buf = [0u8; 1024];
7394 rng.fill_bytes(&mut buf);
7395 let mut unstructured = Unstructured::new(&buf);
7396 Self::arbitrary(&mut unstructured).unwrap_or_default()
7397 }
7398}
7399impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7400 fn default() -> Self {
7401 Self::DEFAULT.clone()
7402 }
7403}
7404impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7405 type Message = MavMessage;
7406 const ID: u32 = 276u32;
7407 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7408 const EXTRA_CRC: u8 = 18u8;
7409 const ENCODED_LEN: usize = 50usize;
7410 fn deser(
7411 _version: MavlinkVersion,
7412 __input: &[u8],
7413 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7414 let avail_len = __input.len();
7415 let mut payload_buf = [0; Self::ENCODED_LEN];
7416 let mut buf = if avail_len < Self::ENCODED_LEN {
7417 payload_buf[0..avail_len].copy_from_slice(__input);
7418 Bytes::new(&payload_buf)
7419 } else {
7420 Bytes::new(__input)
7421 };
7422 let mut __struct = Self::default();
7423 __struct.lat = buf.get_i32_le();
7424 __struct.lon = buf.get_i32_le();
7425 __struct.alt = buf.get_f32_le();
7426 __struct.h_acc = buf.get_f32_le();
7427 __struct.v_acc = buf.get_f32_le();
7428 __struct.vel_n = buf.get_f32_le();
7429 __struct.vel_e = buf.get_f32_le();
7430 __struct.vel_d = buf.get_f32_le();
7431 __struct.vel_acc = buf.get_f32_le();
7432 __struct.dist = buf.get_f32_le();
7433 __struct.hdg = buf.get_f32_le();
7434 __struct.hdg_acc = buf.get_f32_le();
7435 let tmp = buf.get_u8();
7436 __struct.tracking_status =
7437 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7438 enum_type: "CameraTrackingStatusFlags",
7439 value: tmp as u32,
7440 })?;
7441 __struct.camera_device_id = buf.get_u8();
7442 Ok(__struct)
7443 }
7444 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7445 let mut __tmp = BytesMut::new(bytes);
7446 #[allow(clippy::absurd_extreme_comparisons)]
7447 #[allow(unused_comparisons)]
7448 if __tmp.remaining() < Self::ENCODED_LEN {
7449 panic!(
7450 "buffer is too small (need {} bytes, but got {})",
7451 Self::ENCODED_LEN,
7452 __tmp.remaining(),
7453 )
7454 }
7455 __tmp.put_i32_le(self.lat);
7456 __tmp.put_i32_le(self.lon);
7457 __tmp.put_f32_le(self.alt);
7458 __tmp.put_f32_le(self.h_acc);
7459 __tmp.put_f32_le(self.v_acc);
7460 __tmp.put_f32_le(self.vel_n);
7461 __tmp.put_f32_le(self.vel_e);
7462 __tmp.put_f32_le(self.vel_d);
7463 __tmp.put_f32_le(self.vel_acc);
7464 __tmp.put_f32_le(self.dist);
7465 __tmp.put_f32_le(self.hdg);
7466 __tmp.put_f32_le(self.hdg_acc);
7467 __tmp.put_u8(self.tracking_status as u8);
7468 __tmp.put_u8(self.camera_device_id);
7469 if matches!(version, MavlinkVersion::V2) {
7470 let len = __tmp.len();
7471 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7472 } else {
7473 __tmp.len()
7474 }
7475 }
7476}
7477#[doc = "id: 275"]
7478#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7479#[derive(Debug, Clone, PartialEq)]
7480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7481#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7482pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7483 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7484 pub point_x: f32,
7485 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7486 pub point_y: f32,
7487 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7488 pub radius: f32,
7489 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7490 pub rec_top_x: f32,
7491 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7492 pub rec_top_y: f32,
7493 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7494 pub rec_bottom_x: f32,
7495 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7496 pub rec_bottom_y: f32,
7497 #[doc = "Current tracking status"]
7498 pub tracking_status: CameraTrackingStatusFlags,
7499 #[doc = "Current tracking mode"]
7500 pub tracking_mode: CameraTrackingMode,
7501 #[doc = "Defines location of target data"]
7502 pub target_data: CameraTrackingTargetData,
7503 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7504 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7505 pub camera_device_id: u8,
7506}
7507impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7508 pub const ENCODED_LEN: usize = 32usize;
7509 pub const DEFAULT: Self = Self {
7510 point_x: 0.0_f32,
7511 point_y: 0.0_f32,
7512 radius: 0.0_f32,
7513 rec_top_x: 0.0_f32,
7514 rec_top_y: 0.0_f32,
7515 rec_bottom_x: 0.0_f32,
7516 rec_bottom_y: 0.0_f32,
7517 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7518 tracking_mode: CameraTrackingMode::DEFAULT,
7519 target_data: CameraTrackingTargetData::DEFAULT,
7520 camera_device_id: 0_u8,
7521 };
7522 #[cfg(feature = "arbitrary")]
7523 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7524 use arbitrary::{Arbitrary, Unstructured};
7525 let mut buf = [0u8; 1024];
7526 rng.fill_bytes(&mut buf);
7527 let mut unstructured = Unstructured::new(&buf);
7528 Self::arbitrary(&mut unstructured).unwrap_or_default()
7529 }
7530}
7531impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7532 fn default() -> Self {
7533 Self::DEFAULT.clone()
7534 }
7535}
7536impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7537 type Message = MavMessage;
7538 const ID: u32 = 275u32;
7539 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7540 const EXTRA_CRC: u8 = 126u8;
7541 const ENCODED_LEN: usize = 32usize;
7542 fn deser(
7543 _version: MavlinkVersion,
7544 __input: &[u8],
7545 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7546 let avail_len = __input.len();
7547 let mut payload_buf = [0; Self::ENCODED_LEN];
7548 let mut buf = if avail_len < Self::ENCODED_LEN {
7549 payload_buf[0..avail_len].copy_from_slice(__input);
7550 Bytes::new(&payload_buf)
7551 } else {
7552 Bytes::new(__input)
7553 };
7554 let mut __struct = Self::default();
7555 __struct.point_x = buf.get_f32_le();
7556 __struct.point_y = buf.get_f32_le();
7557 __struct.radius = buf.get_f32_le();
7558 __struct.rec_top_x = buf.get_f32_le();
7559 __struct.rec_top_y = buf.get_f32_le();
7560 __struct.rec_bottom_x = buf.get_f32_le();
7561 __struct.rec_bottom_y = buf.get_f32_le();
7562 let tmp = buf.get_u8();
7563 __struct.tracking_status =
7564 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7565 enum_type: "CameraTrackingStatusFlags",
7566 value: tmp as u32,
7567 })?;
7568 let tmp = buf.get_u8();
7569 __struct.tracking_mode =
7570 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7571 enum_type: "CameraTrackingMode",
7572 value: tmp as u32,
7573 })?;
7574 let tmp = buf.get_u8();
7575 __struct.target_data =
7576 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7577 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7578 flag_type: "CameraTrackingTargetData",
7579 value: tmp as u32,
7580 })?;
7581 __struct.camera_device_id = buf.get_u8();
7582 Ok(__struct)
7583 }
7584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7585 let mut __tmp = BytesMut::new(bytes);
7586 #[allow(clippy::absurd_extreme_comparisons)]
7587 #[allow(unused_comparisons)]
7588 if __tmp.remaining() < Self::ENCODED_LEN {
7589 panic!(
7590 "buffer is too small (need {} bytes, but got {})",
7591 Self::ENCODED_LEN,
7592 __tmp.remaining(),
7593 )
7594 }
7595 __tmp.put_f32_le(self.point_x);
7596 __tmp.put_f32_le(self.point_y);
7597 __tmp.put_f32_le(self.radius);
7598 __tmp.put_f32_le(self.rec_top_x);
7599 __tmp.put_f32_le(self.rec_top_y);
7600 __tmp.put_f32_le(self.rec_bottom_x);
7601 __tmp.put_f32_le(self.rec_bottom_y);
7602 __tmp.put_u8(self.tracking_status as u8);
7603 __tmp.put_u8(self.tracking_mode as u8);
7604 __tmp.put_u8(self.target_data.bits());
7605 __tmp.put_u8(self.camera_device_id);
7606 if matches!(version, MavlinkVersion::V2) {
7607 let len = __tmp.len();
7608 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7609 } else {
7610 __tmp.len()
7611 }
7612 }
7613}
7614#[doc = "id: 112"]
7615#[doc = "Camera-IMU triggering and synchronisation message."]
7616#[derive(Debug, Clone, PartialEq)]
7617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7619pub struct CAMERA_TRIGGER_DATA {
7620 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7621 pub time_usec: u64,
7622 #[doc = "Image frame sequence"]
7623 pub seq: u32,
7624}
7625impl CAMERA_TRIGGER_DATA {
7626 pub const ENCODED_LEN: usize = 12usize;
7627 pub const DEFAULT: Self = Self {
7628 time_usec: 0_u64,
7629 seq: 0_u32,
7630 };
7631 #[cfg(feature = "arbitrary")]
7632 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7633 use arbitrary::{Arbitrary, Unstructured};
7634 let mut buf = [0u8; 1024];
7635 rng.fill_bytes(&mut buf);
7636 let mut unstructured = Unstructured::new(&buf);
7637 Self::arbitrary(&mut unstructured).unwrap_or_default()
7638 }
7639}
7640impl Default for CAMERA_TRIGGER_DATA {
7641 fn default() -> Self {
7642 Self::DEFAULT.clone()
7643 }
7644}
7645impl MessageData for CAMERA_TRIGGER_DATA {
7646 type Message = MavMessage;
7647 const ID: u32 = 112u32;
7648 const NAME: &'static str = "CAMERA_TRIGGER";
7649 const EXTRA_CRC: u8 = 174u8;
7650 const ENCODED_LEN: usize = 12usize;
7651 fn deser(
7652 _version: MavlinkVersion,
7653 __input: &[u8],
7654 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7655 let avail_len = __input.len();
7656 let mut payload_buf = [0; Self::ENCODED_LEN];
7657 let mut buf = if avail_len < Self::ENCODED_LEN {
7658 payload_buf[0..avail_len].copy_from_slice(__input);
7659 Bytes::new(&payload_buf)
7660 } else {
7661 Bytes::new(__input)
7662 };
7663 let mut __struct = Self::default();
7664 __struct.time_usec = buf.get_u64_le();
7665 __struct.seq = buf.get_u32_le();
7666 Ok(__struct)
7667 }
7668 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7669 let mut __tmp = BytesMut::new(bytes);
7670 #[allow(clippy::absurd_extreme_comparisons)]
7671 #[allow(unused_comparisons)]
7672 if __tmp.remaining() < Self::ENCODED_LEN {
7673 panic!(
7674 "buffer is too small (need {} bytes, but got {})",
7675 Self::ENCODED_LEN,
7676 __tmp.remaining(),
7677 )
7678 }
7679 __tmp.put_u64_le(self.time_usec);
7680 __tmp.put_u32_le(self.seq);
7681 if matches!(version, MavlinkVersion::V2) {
7682 let len = __tmp.len();
7683 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7684 } else {
7685 __tmp.len()
7686 }
7687 }
7688}
7689#[doc = "id: 387"]
7690#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
7691#[derive(Debug, Clone, PartialEq)]
7692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7693#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7694pub struct CANFD_FRAME_DATA {
7695 #[doc = "Frame ID"]
7696 pub id: u32,
7697 #[doc = "System ID."]
7698 pub target_system: u8,
7699 #[doc = "Component ID."]
7700 pub target_component: u8,
7701 #[doc = "bus number"]
7702 pub bus: u8,
7703 #[doc = "Frame length"]
7704 pub len: u8,
7705 #[doc = "Frame data"]
7706 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7707 pub data: [u8; 64],
7708}
7709impl CANFD_FRAME_DATA {
7710 pub const ENCODED_LEN: usize = 72usize;
7711 pub const DEFAULT: Self = Self {
7712 id: 0_u32,
7713 target_system: 0_u8,
7714 target_component: 0_u8,
7715 bus: 0_u8,
7716 len: 0_u8,
7717 data: [0_u8; 64usize],
7718 };
7719 #[cfg(feature = "arbitrary")]
7720 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7721 use arbitrary::{Arbitrary, Unstructured};
7722 let mut buf = [0u8; 1024];
7723 rng.fill_bytes(&mut buf);
7724 let mut unstructured = Unstructured::new(&buf);
7725 Self::arbitrary(&mut unstructured).unwrap_or_default()
7726 }
7727}
7728impl Default for CANFD_FRAME_DATA {
7729 fn default() -> Self {
7730 Self::DEFAULT.clone()
7731 }
7732}
7733impl MessageData for CANFD_FRAME_DATA {
7734 type Message = MavMessage;
7735 const ID: u32 = 387u32;
7736 const NAME: &'static str = "CANFD_FRAME";
7737 const EXTRA_CRC: u8 = 4u8;
7738 const ENCODED_LEN: usize = 72usize;
7739 fn deser(
7740 _version: MavlinkVersion,
7741 __input: &[u8],
7742 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7743 let avail_len = __input.len();
7744 let mut payload_buf = [0; Self::ENCODED_LEN];
7745 let mut buf = if avail_len < Self::ENCODED_LEN {
7746 payload_buf[0..avail_len].copy_from_slice(__input);
7747 Bytes::new(&payload_buf)
7748 } else {
7749 Bytes::new(__input)
7750 };
7751 let mut __struct = Self::default();
7752 __struct.id = buf.get_u32_le();
7753 __struct.target_system = buf.get_u8();
7754 __struct.target_component = buf.get_u8();
7755 __struct.bus = buf.get_u8();
7756 __struct.len = buf.get_u8();
7757 for v in &mut __struct.data {
7758 let val = buf.get_u8();
7759 *v = val;
7760 }
7761 Ok(__struct)
7762 }
7763 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7764 let mut __tmp = BytesMut::new(bytes);
7765 #[allow(clippy::absurd_extreme_comparisons)]
7766 #[allow(unused_comparisons)]
7767 if __tmp.remaining() < Self::ENCODED_LEN {
7768 panic!(
7769 "buffer is too small (need {} bytes, but got {})",
7770 Self::ENCODED_LEN,
7771 __tmp.remaining(),
7772 )
7773 }
7774 __tmp.put_u32_le(self.id);
7775 __tmp.put_u8(self.target_system);
7776 __tmp.put_u8(self.target_component);
7777 __tmp.put_u8(self.bus);
7778 __tmp.put_u8(self.len);
7779 for val in &self.data {
7780 __tmp.put_u8(*val);
7781 }
7782 if matches!(version, MavlinkVersion::V2) {
7783 let len = __tmp.len();
7784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7785 } else {
7786 __tmp.len()
7787 }
7788 }
7789}
7790#[doc = "id: 388"]
7791#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
7792#[derive(Debug, Clone, PartialEq)]
7793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7795pub struct CAN_FILTER_MODIFY_DATA {
7796 #[doc = "filter IDs, length num_ids"]
7797 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7798 pub ids: [u16; 16],
7799 #[doc = "System ID."]
7800 pub target_system: u8,
7801 #[doc = "Component ID."]
7802 pub target_component: u8,
7803 #[doc = "bus number"]
7804 pub bus: u8,
7805 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
7806 pub operation: CanFilterOp,
7807 #[doc = "number of IDs in filter list"]
7808 pub num_ids: u8,
7809}
7810impl CAN_FILTER_MODIFY_DATA {
7811 pub const ENCODED_LEN: usize = 37usize;
7812 pub const DEFAULT: Self = Self {
7813 ids: [0_u16; 16usize],
7814 target_system: 0_u8,
7815 target_component: 0_u8,
7816 bus: 0_u8,
7817 operation: CanFilterOp::DEFAULT,
7818 num_ids: 0_u8,
7819 };
7820 #[cfg(feature = "arbitrary")]
7821 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7822 use arbitrary::{Arbitrary, Unstructured};
7823 let mut buf = [0u8; 1024];
7824 rng.fill_bytes(&mut buf);
7825 let mut unstructured = Unstructured::new(&buf);
7826 Self::arbitrary(&mut unstructured).unwrap_or_default()
7827 }
7828}
7829impl Default for CAN_FILTER_MODIFY_DATA {
7830 fn default() -> Self {
7831 Self::DEFAULT.clone()
7832 }
7833}
7834impl MessageData for CAN_FILTER_MODIFY_DATA {
7835 type Message = MavMessage;
7836 const ID: u32 = 388u32;
7837 const NAME: &'static str = "CAN_FILTER_MODIFY";
7838 const EXTRA_CRC: u8 = 8u8;
7839 const ENCODED_LEN: usize = 37usize;
7840 fn deser(
7841 _version: MavlinkVersion,
7842 __input: &[u8],
7843 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7844 let avail_len = __input.len();
7845 let mut payload_buf = [0; Self::ENCODED_LEN];
7846 let mut buf = if avail_len < Self::ENCODED_LEN {
7847 payload_buf[0..avail_len].copy_from_slice(__input);
7848 Bytes::new(&payload_buf)
7849 } else {
7850 Bytes::new(__input)
7851 };
7852 let mut __struct = Self::default();
7853 for v in &mut __struct.ids {
7854 let val = buf.get_u16_le();
7855 *v = val;
7856 }
7857 __struct.target_system = buf.get_u8();
7858 __struct.target_component = buf.get_u8();
7859 __struct.bus = buf.get_u8();
7860 let tmp = buf.get_u8();
7861 __struct.operation =
7862 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7863 enum_type: "CanFilterOp",
7864 value: tmp as u32,
7865 })?;
7866 __struct.num_ids = buf.get_u8();
7867 Ok(__struct)
7868 }
7869 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7870 let mut __tmp = BytesMut::new(bytes);
7871 #[allow(clippy::absurd_extreme_comparisons)]
7872 #[allow(unused_comparisons)]
7873 if __tmp.remaining() < Self::ENCODED_LEN {
7874 panic!(
7875 "buffer is too small (need {} bytes, but got {})",
7876 Self::ENCODED_LEN,
7877 __tmp.remaining(),
7878 )
7879 }
7880 for val in &self.ids {
7881 __tmp.put_u16_le(*val);
7882 }
7883 __tmp.put_u8(self.target_system);
7884 __tmp.put_u8(self.target_component);
7885 __tmp.put_u8(self.bus);
7886 __tmp.put_u8(self.operation as u8);
7887 __tmp.put_u8(self.num_ids);
7888 if matches!(version, MavlinkVersion::V2) {
7889 let len = __tmp.len();
7890 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7891 } else {
7892 __tmp.len()
7893 }
7894 }
7895}
7896#[doc = "id: 386"]
7897#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
7898#[derive(Debug, Clone, PartialEq)]
7899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7901pub struct CAN_FRAME_DATA {
7902 #[doc = "Frame ID"]
7903 pub id: u32,
7904 #[doc = "System ID."]
7905 pub target_system: u8,
7906 #[doc = "Component ID."]
7907 pub target_component: u8,
7908 #[doc = "Bus number"]
7909 pub bus: u8,
7910 #[doc = "Frame length"]
7911 pub len: u8,
7912 #[doc = "Frame data"]
7913 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7914 pub data: [u8; 8],
7915}
7916impl CAN_FRAME_DATA {
7917 pub const ENCODED_LEN: usize = 16usize;
7918 pub const DEFAULT: Self = Self {
7919 id: 0_u32,
7920 target_system: 0_u8,
7921 target_component: 0_u8,
7922 bus: 0_u8,
7923 len: 0_u8,
7924 data: [0_u8; 8usize],
7925 };
7926 #[cfg(feature = "arbitrary")]
7927 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7928 use arbitrary::{Arbitrary, Unstructured};
7929 let mut buf = [0u8; 1024];
7930 rng.fill_bytes(&mut buf);
7931 let mut unstructured = Unstructured::new(&buf);
7932 Self::arbitrary(&mut unstructured).unwrap_or_default()
7933 }
7934}
7935impl Default for CAN_FRAME_DATA {
7936 fn default() -> Self {
7937 Self::DEFAULT.clone()
7938 }
7939}
7940impl MessageData for CAN_FRAME_DATA {
7941 type Message = MavMessage;
7942 const ID: u32 = 386u32;
7943 const NAME: &'static str = "CAN_FRAME";
7944 const EXTRA_CRC: u8 = 132u8;
7945 const ENCODED_LEN: usize = 16usize;
7946 fn deser(
7947 _version: MavlinkVersion,
7948 __input: &[u8],
7949 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7950 let avail_len = __input.len();
7951 let mut payload_buf = [0; Self::ENCODED_LEN];
7952 let mut buf = if avail_len < Self::ENCODED_LEN {
7953 payload_buf[0..avail_len].copy_from_slice(__input);
7954 Bytes::new(&payload_buf)
7955 } else {
7956 Bytes::new(__input)
7957 };
7958 let mut __struct = Self::default();
7959 __struct.id = buf.get_u32_le();
7960 __struct.target_system = buf.get_u8();
7961 __struct.target_component = buf.get_u8();
7962 __struct.bus = buf.get_u8();
7963 __struct.len = buf.get_u8();
7964 for v in &mut __struct.data {
7965 let val = buf.get_u8();
7966 *v = val;
7967 }
7968 Ok(__struct)
7969 }
7970 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7971 let mut __tmp = BytesMut::new(bytes);
7972 #[allow(clippy::absurd_extreme_comparisons)]
7973 #[allow(unused_comparisons)]
7974 if __tmp.remaining() < Self::ENCODED_LEN {
7975 panic!(
7976 "buffer is too small (need {} bytes, but got {})",
7977 Self::ENCODED_LEN,
7978 __tmp.remaining(),
7979 )
7980 }
7981 __tmp.put_u32_le(self.id);
7982 __tmp.put_u8(self.target_system);
7983 __tmp.put_u8(self.target_component);
7984 __tmp.put_u8(self.bus);
7985 __tmp.put_u8(self.len);
7986 for val in &self.data {
7987 __tmp.put_u8(*val);
7988 }
7989 if matches!(version, MavlinkVersion::V2) {
7990 let len = __tmp.len();
7991 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7992 } else {
7993 __tmp.len()
7994 }
7995 }
7996}
7997#[doc = "id: 336"]
7998#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
7999#[derive(Debug, Clone, PartialEq)]
8000#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8001#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8002pub struct CELLULAR_CONFIG_DATA {
8003 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8004 pub enable_lte: u8,
8005 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8006 pub enable_pin: u8,
8007 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8008 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8009 pub pin: [u8; 16],
8010 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8011 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8012 pub new_pin: [u8; 16],
8013 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8014 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8015 pub apn: [u8; 32],
8016 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8017 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8018 pub puk: [u8; 16],
8019 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8020 pub roaming: u8,
8021 #[doc = "Message acceptance response (sent back to GS)."]
8022 pub response: CellularConfigResponse,
8023}
8024impl CELLULAR_CONFIG_DATA {
8025 pub const ENCODED_LEN: usize = 84usize;
8026 pub const DEFAULT: Self = Self {
8027 enable_lte: 0_u8,
8028 enable_pin: 0_u8,
8029 pin: [0_u8; 16usize],
8030 new_pin: [0_u8; 16usize],
8031 apn: [0_u8; 32usize],
8032 puk: [0_u8; 16usize],
8033 roaming: 0_u8,
8034 response: CellularConfigResponse::DEFAULT,
8035 };
8036 #[cfg(feature = "arbitrary")]
8037 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8038 use arbitrary::{Arbitrary, Unstructured};
8039 let mut buf = [0u8; 1024];
8040 rng.fill_bytes(&mut buf);
8041 let mut unstructured = Unstructured::new(&buf);
8042 Self::arbitrary(&mut unstructured).unwrap_or_default()
8043 }
8044}
8045impl Default for CELLULAR_CONFIG_DATA {
8046 fn default() -> Self {
8047 Self::DEFAULT.clone()
8048 }
8049}
8050impl MessageData for CELLULAR_CONFIG_DATA {
8051 type Message = MavMessage;
8052 const ID: u32 = 336u32;
8053 const NAME: &'static str = "CELLULAR_CONFIG";
8054 const EXTRA_CRC: u8 = 245u8;
8055 const ENCODED_LEN: usize = 84usize;
8056 fn deser(
8057 _version: MavlinkVersion,
8058 __input: &[u8],
8059 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8060 let avail_len = __input.len();
8061 let mut payload_buf = [0; Self::ENCODED_LEN];
8062 let mut buf = if avail_len < Self::ENCODED_LEN {
8063 payload_buf[0..avail_len].copy_from_slice(__input);
8064 Bytes::new(&payload_buf)
8065 } else {
8066 Bytes::new(__input)
8067 };
8068 let mut __struct = Self::default();
8069 __struct.enable_lte = buf.get_u8();
8070 __struct.enable_pin = buf.get_u8();
8071 for v in &mut __struct.pin {
8072 let val = buf.get_u8();
8073 *v = val;
8074 }
8075 for v in &mut __struct.new_pin {
8076 let val = buf.get_u8();
8077 *v = val;
8078 }
8079 for v in &mut __struct.apn {
8080 let val = buf.get_u8();
8081 *v = val;
8082 }
8083 for v in &mut __struct.puk {
8084 let val = buf.get_u8();
8085 *v = val;
8086 }
8087 __struct.roaming = buf.get_u8();
8088 let tmp = buf.get_u8();
8089 __struct.response =
8090 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8091 enum_type: "CellularConfigResponse",
8092 value: tmp as u32,
8093 })?;
8094 Ok(__struct)
8095 }
8096 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8097 let mut __tmp = BytesMut::new(bytes);
8098 #[allow(clippy::absurd_extreme_comparisons)]
8099 #[allow(unused_comparisons)]
8100 if __tmp.remaining() < Self::ENCODED_LEN {
8101 panic!(
8102 "buffer is too small (need {} bytes, but got {})",
8103 Self::ENCODED_LEN,
8104 __tmp.remaining(),
8105 )
8106 }
8107 __tmp.put_u8(self.enable_lte);
8108 __tmp.put_u8(self.enable_pin);
8109 for val in &self.pin {
8110 __tmp.put_u8(*val);
8111 }
8112 for val in &self.new_pin {
8113 __tmp.put_u8(*val);
8114 }
8115 for val in &self.apn {
8116 __tmp.put_u8(*val);
8117 }
8118 for val in &self.puk {
8119 __tmp.put_u8(*val);
8120 }
8121 __tmp.put_u8(self.roaming);
8122 __tmp.put_u8(self.response as u8);
8123 if matches!(version, MavlinkVersion::V2) {
8124 let len = __tmp.len();
8125 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8126 } else {
8127 __tmp.len()
8128 }
8129 }
8130}
8131#[doc = "id: 334"]
8132#[doc = "Report current used cellular network status."]
8133#[derive(Debug, Clone, PartialEq)]
8134#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8136pub struct CELLULAR_STATUS_DATA {
8137 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8138 pub mcc: u16,
8139 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8140 pub mnc: u16,
8141 #[doc = "Location area code. If unknown, set to 0"]
8142 pub lac: u16,
8143 #[doc = "Cellular modem status"]
8144 pub status: CellularStatusFlag,
8145 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8146 pub failure_reason: CellularNetworkFailedReason,
8147 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8148 pub mavtype: CellularNetworkRadioType,
8149 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8150 pub quality: u8,
8151}
8152impl CELLULAR_STATUS_DATA {
8153 pub const ENCODED_LEN: usize = 10usize;
8154 pub const DEFAULT: Self = Self {
8155 mcc: 0_u16,
8156 mnc: 0_u16,
8157 lac: 0_u16,
8158 status: CellularStatusFlag::DEFAULT,
8159 failure_reason: CellularNetworkFailedReason::DEFAULT,
8160 mavtype: CellularNetworkRadioType::DEFAULT,
8161 quality: 0_u8,
8162 };
8163 #[cfg(feature = "arbitrary")]
8164 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8165 use arbitrary::{Arbitrary, Unstructured};
8166 let mut buf = [0u8; 1024];
8167 rng.fill_bytes(&mut buf);
8168 let mut unstructured = Unstructured::new(&buf);
8169 Self::arbitrary(&mut unstructured).unwrap_or_default()
8170 }
8171}
8172impl Default for CELLULAR_STATUS_DATA {
8173 fn default() -> Self {
8174 Self::DEFAULT.clone()
8175 }
8176}
8177impl MessageData for CELLULAR_STATUS_DATA {
8178 type Message = MavMessage;
8179 const ID: u32 = 334u32;
8180 const NAME: &'static str = "CELLULAR_STATUS";
8181 const EXTRA_CRC: u8 = 72u8;
8182 const ENCODED_LEN: usize = 10usize;
8183 fn deser(
8184 _version: MavlinkVersion,
8185 __input: &[u8],
8186 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8187 let avail_len = __input.len();
8188 let mut payload_buf = [0; Self::ENCODED_LEN];
8189 let mut buf = if avail_len < Self::ENCODED_LEN {
8190 payload_buf[0..avail_len].copy_from_slice(__input);
8191 Bytes::new(&payload_buf)
8192 } else {
8193 Bytes::new(__input)
8194 };
8195 let mut __struct = Self::default();
8196 __struct.mcc = buf.get_u16_le();
8197 __struct.mnc = buf.get_u16_le();
8198 __struct.lac = buf.get_u16_le();
8199 let tmp = buf.get_u8();
8200 __struct.status =
8201 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8202 enum_type: "CellularStatusFlag",
8203 value: tmp as u32,
8204 })?;
8205 let tmp = buf.get_u8();
8206 __struct.failure_reason =
8207 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8208 enum_type: "CellularNetworkFailedReason",
8209 value: tmp as u32,
8210 })?;
8211 let tmp = buf.get_u8();
8212 __struct.mavtype =
8213 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8214 enum_type: "CellularNetworkRadioType",
8215 value: tmp as u32,
8216 })?;
8217 __struct.quality = buf.get_u8();
8218 Ok(__struct)
8219 }
8220 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8221 let mut __tmp = BytesMut::new(bytes);
8222 #[allow(clippy::absurd_extreme_comparisons)]
8223 #[allow(unused_comparisons)]
8224 if __tmp.remaining() < Self::ENCODED_LEN {
8225 panic!(
8226 "buffer is too small (need {} bytes, but got {})",
8227 Self::ENCODED_LEN,
8228 __tmp.remaining(),
8229 )
8230 }
8231 __tmp.put_u16_le(self.mcc);
8232 __tmp.put_u16_le(self.mnc);
8233 __tmp.put_u16_le(self.lac);
8234 __tmp.put_u8(self.status as u8);
8235 __tmp.put_u8(self.failure_reason as u8);
8236 __tmp.put_u8(self.mavtype as u8);
8237 __tmp.put_u8(self.quality);
8238 if matches!(version, MavlinkVersion::V2) {
8239 let len = __tmp.len();
8240 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8241 } else {
8242 __tmp.len()
8243 }
8244 }
8245}
8246#[doc = "id: 5"]
8247#[doc = "Request to control this MAV."]
8248#[derive(Debug, Clone, PartialEq)]
8249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8250#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8251pub struct CHANGE_OPERATOR_CONTROL_DATA {
8252 #[doc = "System the GCS requests control for"]
8253 pub target_system: u8,
8254 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8255 pub control_request: u8,
8256 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8257 pub version: u8,
8258 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8259 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8260 pub passkey: [u8; 25],
8261}
8262impl CHANGE_OPERATOR_CONTROL_DATA {
8263 pub const ENCODED_LEN: usize = 28usize;
8264 pub const DEFAULT: Self = Self {
8265 target_system: 0_u8,
8266 control_request: 0_u8,
8267 version: 0_u8,
8268 passkey: [0_u8; 25usize],
8269 };
8270 #[cfg(feature = "arbitrary")]
8271 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8272 use arbitrary::{Arbitrary, Unstructured};
8273 let mut buf = [0u8; 1024];
8274 rng.fill_bytes(&mut buf);
8275 let mut unstructured = Unstructured::new(&buf);
8276 Self::arbitrary(&mut unstructured).unwrap_or_default()
8277 }
8278}
8279impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8280 fn default() -> Self {
8281 Self::DEFAULT.clone()
8282 }
8283}
8284impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8285 type Message = MavMessage;
8286 const ID: u32 = 5u32;
8287 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8288 const EXTRA_CRC: u8 = 217u8;
8289 const ENCODED_LEN: usize = 28usize;
8290 fn deser(
8291 _version: MavlinkVersion,
8292 __input: &[u8],
8293 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8294 let avail_len = __input.len();
8295 let mut payload_buf = [0; Self::ENCODED_LEN];
8296 let mut buf = if avail_len < Self::ENCODED_LEN {
8297 payload_buf[0..avail_len].copy_from_slice(__input);
8298 Bytes::new(&payload_buf)
8299 } else {
8300 Bytes::new(__input)
8301 };
8302 let mut __struct = Self::default();
8303 __struct.target_system = buf.get_u8();
8304 __struct.control_request = buf.get_u8();
8305 __struct.version = buf.get_u8();
8306 for v in &mut __struct.passkey {
8307 let val = buf.get_u8();
8308 *v = val;
8309 }
8310 Ok(__struct)
8311 }
8312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8313 let mut __tmp = BytesMut::new(bytes);
8314 #[allow(clippy::absurd_extreme_comparisons)]
8315 #[allow(unused_comparisons)]
8316 if __tmp.remaining() < Self::ENCODED_LEN {
8317 panic!(
8318 "buffer is too small (need {} bytes, but got {})",
8319 Self::ENCODED_LEN,
8320 __tmp.remaining(),
8321 )
8322 }
8323 __tmp.put_u8(self.target_system);
8324 __tmp.put_u8(self.control_request);
8325 __tmp.put_u8(self.version);
8326 for val in &self.passkey {
8327 __tmp.put_u8(*val);
8328 }
8329 if matches!(version, MavlinkVersion::V2) {
8330 let len = __tmp.len();
8331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8332 } else {
8333 __tmp.len()
8334 }
8335 }
8336}
8337#[doc = "id: 6"]
8338#[doc = "Accept / deny control of this MAV."]
8339#[derive(Debug, Clone, PartialEq)]
8340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8342pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8343 #[doc = "ID of the GCS this message"]
8344 pub gcs_system_id: u8,
8345 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8346 pub control_request: u8,
8347 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8348 pub ack: u8,
8349}
8350impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8351 pub const ENCODED_LEN: usize = 3usize;
8352 pub const DEFAULT: Self = Self {
8353 gcs_system_id: 0_u8,
8354 control_request: 0_u8,
8355 ack: 0_u8,
8356 };
8357 #[cfg(feature = "arbitrary")]
8358 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8359 use arbitrary::{Arbitrary, Unstructured};
8360 let mut buf = [0u8; 1024];
8361 rng.fill_bytes(&mut buf);
8362 let mut unstructured = Unstructured::new(&buf);
8363 Self::arbitrary(&mut unstructured).unwrap_or_default()
8364 }
8365}
8366impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8367 fn default() -> Self {
8368 Self::DEFAULT.clone()
8369 }
8370}
8371impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8372 type Message = MavMessage;
8373 const ID: u32 = 6u32;
8374 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8375 const EXTRA_CRC: u8 = 104u8;
8376 const ENCODED_LEN: usize = 3usize;
8377 fn deser(
8378 _version: MavlinkVersion,
8379 __input: &[u8],
8380 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8381 let avail_len = __input.len();
8382 let mut payload_buf = [0; Self::ENCODED_LEN];
8383 let mut buf = if avail_len < Self::ENCODED_LEN {
8384 payload_buf[0..avail_len].copy_from_slice(__input);
8385 Bytes::new(&payload_buf)
8386 } else {
8387 Bytes::new(__input)
8388 };
8389 let mut __struct = Self::default();
8390 __struct.gcs_system_id = buf.get_u8();
8391 __struct.control_request = buf.get_u8();
8392 __struct.ack = buf.get_u8();
8393 Ok(__struct)
8394 }
8395 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8396 let mut __tmp = BytesMut::new(bytes);
8397 #[allow(clippy::absurd_extreme_comparisons)]
8398 #[allow(unused_comparisons)]
8399 if __tmp.remaining() < Self::ENCODED_LEN {
8400 panic!(
8401 "buffer is too small (need {} bytes, but got {})",
8402 Self::ENCODED_LEN,
8403 __tmp.remaining(),
8404 )
8405 }
8406 __tmp.put_u8(self.gcs_system_id);
8407 __tmp.put_u8(self.control_request);
8408 __tmp.put_u8(self.ack);
8409 if matches!(version, MavlinkVersion::V2) {
8410 let len = __tmp.len();
8411 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8412 } else {
8413 __tmp.len()
8414 }
8415 }
8416}
8417#[doc = "id: 247"]
8418#[doc = "Information about a potential collision."]
8419#[derive(Debug, Clone, PartialEq)]
8420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8422pub struct COLLISION_DATA {
8423 #[doc = "Unique identifier, domain based on src field"]
8424 pub id: u32,
8425 #[doc = "Estimated time until collision occurs"]
8426 pub time_to_minimum_delta: f32,
8427 #[doc = "Closest vertical distance between vehicle and object"]
8428 pub altitude_minimum_delta: f32,
8429 #[doc = "Closest horizontal distance between vehicle and object"]
8430 pub horizontal_minimum_delta: f32,
8431 #[doc = "Collision data source"]
8432 pub src: MavCollisionSrc,
8433 #[doc = "Action that is being taken to avoid this collision"]
8434 pub action: MavCollisionAction,
8435 #[doc = "How concerned the aircraft is about this collision"]
8436 pub threat_level: MavCollisionThreatLevel,
8437}
8438impl COLLISION_DATA {
8439 pub const ENCODED_LEN: usize = 19usize;
8440 pub const DEFAULT: Self = Self {
8441 id: 0_u32,
8442 time_to_minimum_delta: 0.0_f32,
8443 altitude_minimum_delta: 0.0_f32,
8444 horizontal_minimum_delta: 0.0_f32,
8445 src: MavCollisionSrc::DEFAULT,
8446 action: MavCollisionAction::DEFAULT,
8447 threat_level: MavCollisionThreatLevel::DEFAULT,
8448 };
8449 #[cfg(feature = "arbitrary")]
8450 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8451 use arbitrary::{Arbitrary, Unstructured};
8452 let mut buf = [0u8; 1024];
8453 rng.fill_bytes(&mut buf);
8454 let mut unstructured = Unstructured::new(&buf);
8455 Self::arbitrary(&mut unstructured).unwrap_or_default()
8456 }
8457}
8458impl Default for COLLISION_DATA {
8459 fn default() -> Self {
8460 Self::DEFAULT.clone()
8461 }
8462}
8463impl MessageData for COLLISION_DATA {
8464 type Message = MavMessage;
8465 const ID: u32 = 247u32;
8466 const NAME: &'static str = "COLLISION";
8467 const EXTRA_CRC: u8 = 81u8;
8468 const ENCODED_LEN: usize = 19usize;
8469 fn deser(
8470 _version: MavlinkVersion,
8471 __input: &[u8],
8472 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8473 let avail_len = __input.len();
8474 let mut payload_buf = [0; Self::ENCODED_LEN];
8475 let mut buf = if avail_len < Self::ENCODED_LEN {
8476 payload_buf[0..avail_len].copy_from_slice(__input);
8477 Bytes::new(&payload_buf)
8478 } else {
8479 Bytes::new(__input)
8480 };
8481 let mut __struct = Self::default();
8482 __struct.id = buf.get_u32_le();
8483 __struct.time_to_minimum_delta = buf.get_f32_le();
8484 __struct.altitude_minimum_delta = buf.get_f32_le();
8485 __struct.horizontal_minimum_delta = buf.get_f32_le();
8486 let tmp = buf.get_u8();
8487 __struct.src =
8488 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8489 enum_type: "MavCollisionSrc",
8490 value: tmp as u32,
8491 })?;
8492 let tmp = buf.get_u8();
8493 __struct.action =
8494 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8495 enum_type: "MavCollisionAction",
8496 value: tmp as u32,
8497 })?;
8498 let tmp = buf.get_u8();
8499 __struct.threat_level =
8500 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8501 enum_type: "MavCollisionThreatLevel",
8502 value: tmp as u32,
8503 })?;
8504 Ok(__struct)
8505 }
8506 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8507 let mut __tmp = BytesMut::new(bytes);
8508 #[allow(clippy::absurd_extreme_comparisons)]
8509 #[allow(unused_comparisons)]
8510 if __tmp.remaining() < Self::ENCODED_LEN {
8511 panic!(
8512 "buffer is too small (need {} bytes, but got {})",
8513 Self::ENCODED_LEN,
8514 __tmp.remaining(),
8515 )
8516 }
8517 __tmp.put_u32_le(self.id);
8518 __tmp.put_f32_le(self.time_to_minimum_delta);
8519 __tmp.put_f32_le(self.altitude_minimum_delta);
8520 __tmp.put_f32_le(self.horizontal_minimum_delta);
8521 __tmp.put_u8(self.src as u8);
8522 __tmp.put_u8(self.action as u8);
8523 __tmp.put_u8(self.threat_level as u8);
8524 if matches!(version, MavlinkVersion::V2) {
8525 let len = __tmp.len();
8526 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8527 } else {
8528 __tmp.len()
8529 }
8530 }
8531}
8532#[doc = "id: 77"]
8533#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8534#[derive(Debug, Clone, PartialEq)]
8535#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8536#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8537pub struct COMMAND_ACK_DATA {
8538 #[doc = "Command ID (of acknowledged command)."]
8539 pub command: MavCmd,
8540 #[doc = "Result of command."]
8541 pub result: MavResult,
8542 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8543 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8544 pub progress: u8,
8545 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8546 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8547 pub result_param2: i32,
8548 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8549 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8550 pub target_system: u8,
8551 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8552 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8553 pub target_component: u8,
8554}
8555impl COMMAND_ACK_DATA {
8556 pub const ENCODED_LEN: usize = 10usize;
8557 pub const DEFAULT: Self = Self {
8558 command: MavCmd::DEFAULT,
8559 result: MavResult::DEFAULT,
8560 progress: 0_u8,
8561 result_param2: 0_i32,
8562 target_system: 0_u8,
8563 target_component: 0_u8,
8564 };
8565 #[cfg(feature = "arbitrary")]
8566 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8567 use arbitrary::{Arbitrary, Unstructured};
8568 let mut buf = [0u8; 1024];
8569 rng.fill_bytes(&mut buf);
8570 let mut unstructured = Unstructured::new(&buf);
8571 Self::arbitrary(&mut unstructured).unwrap_or_default()
8572 }
8573}
8574impl Default for COMMAND_ACK_DATA {
8575 fn default() -> Self {
8576 Self::DEFAULT.clone()
8577 }
8578}
8579impl MessageData for COMMAND_ACK_DATA {
8580 type Message = MavMessage;
8581 const ID: u32 = 77u32;
8582 const NAME: &'static str = "COMMAND_ACK";
8583 const EXTRA_CRC: u8 = 143u8;
8584 const ENCODED_LEN: usize = 10usize;
8585 fn deser(
8586 _version: MavlinkVersion,
8587 __input: &[u8],
8588 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8589 let avail_len = __input.len();
8590 let mut payload_buf = [0; Self::ENCODED_LEN];
8591 let mut buf = if avail_len < Self::ENCODED_LEN {
8592 payload_buf[0..avail_len].copy_from_slice(__input);
8593 Bytes::new(&payload_buf)
8594 } else {
8595 Bytes::new(__input)
8596 };
8597 let mut __struct = Self::default();
8598 let tmp = buf.get_u16_le();
8599 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8600 ::mavlink_core::error::ParserError::InvalidEnum {
8601 enum_type: "MavCmd",
8602 value: tmp as u32,
8603 },
8604 )?;
8605 let tmp = buf.get_u8();
8606 __struct.result =
8607 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8608 enum_type: "MavResult",
8609 value: tmp as u32,
8610 })?;
8611 __struct.progress = buf.get_u8();
8612 __struct.result_param2 = buf.get_i32_le();
8613 __struct.target_system = buf.get_u8();
8614 __struct.target_component = buf.get_u8();
8615 Ok(__struct)
8616 }
8617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8618 let mut __tmp = BytesMut::new(bytes);
8619 #[allow(clippy::absurd_extreme_comparisons)]
8620 #[allow(unused_comparisons)]
8621 if __tmp.remaining() < Self::ENCODED_LEN {
8622 panic!(
8623 "buffer is too small (need {} bytes, but got {})",
8624 Self::ENCODED_LEN,
8625 __tmp.remaining(),
8626 )
8627 }
8628 __tmp.put_u16_le(self.command as u16);
8629 __tmp.put_u8(self.result as u8);
8630 __tmp.put_u8(self.progress);
8631 __tmp.put_i32_le(self.result_param2);
8632 __tmp.put_u8(self.target_system);
8633 __tmp.put_u8(self.target_component);
8634 if matches!(version, MavlinkVersion::V2) {
8635 let len = __tmp.len();
8636 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8637 } else {
8638 __tmp.len()
8639 }
8640 }
8641}
8642#[doc = "id: 80"]
8643#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8644#[derive(Debug, Clone, PartialEq)]
8645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8647pub struct COMMAND_CANCEL_DATA {
8648 #[doc = "Command ID (of command to cancel)."]
8649 pub command: MavCmd,
8650 #[doc = "System executing long running command. Should not be broadcast (0)."]
8651 pub target_system: u8,
8652 #[doc = "Component executing long running command."]
8653 pub target_component: u8,
8654}
8655impl COMMAND_CANCEL_DATA {
8656 pub const ENCODED_LEN: usize = 4usize;
8657 pub const DEFAULT: Self = Self {
8658 command: MavCmd::DEFAULT,
8659 target_system: 0_u8,
8660 target_component: 0_u8,
8661 };
8662 #[cfg(feature = "arbitrary")]
8663 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8664 use arbitrary::{Arbitrary, Unstructured};
8665 let mut buf = [0u8; 1024];
8666 rng.fill_bytes(&mut buf);
8667 let mut unstructured = Unstructured::new(&buf);
8668 Self::arbitrary(&mut unstructured).unwrap_or_default()
8669 }
8670}
8671impl Default for COMMAND_CANCEL_DATA {
8672 fn default() -> Self {
8673 Self::DEFAULT.clone()
8674 }
8675}
8676impl MessageData for COMMAND_CANCEL_DATA {
8677 type Message = MavMessage;
8678 const ID: u32 = 80u32;
8679 const NAME: &'static str = "COMMAND_CANCEL";
8680 const EXTRA_CRC: u8 = 14u8;
8681 const ENCODED_LEN: usize = 4usize;
8682 fn deser(
8683 _version: MavlinkVersion,
8684 __input: &[u8],
8685 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8686 let avail_len = __input.len();
8687 let mut payload_buf = [0; Self::ENCODED_LEN];
8688 let mut buf = if avail_len < Self::ENCODED_LEN {
8689 payload_buf[0..avail_len].copy_from_slice(__input);
8690 Bytes::new(&payload_buf)
8691 } else {
8692 Bytes::new(__input)
8693 };
8694 let mut __struct = Self::default();
8695 let tmp = buf.get_u16_le();
8696 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8697 ::mavlink_core::error::ParserError::InvalidEnum {
8698 enum_type: "MavCmd",
8699 value: tmp as u32,
8700 },
8701 )?;
8702 __struct.target_system = buf.get_u8();
8703 __struct.target_component = buf.get_u8();
8704 Ok(__struct)
8705 }
8706 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8707 let mut __tmp = BytesMut::new(bytes);
8708 #[allow(clippy::absurd_extreme_comparisons)]
8709 #[allow(unused_comparisons)]
8710 if __tmp.remaining() < Self::ENCODED_LEN {
8711 panic!(
8712 "buffer is too small (need {} bytes, but got {})",
8713 Self::ENCODED_LEN,
8714 __tmp.remaining(),
8715 )
8716 }
8717 __tmp.put_u16_le(self.command as u16);
8718 __tmp.put_u8(self.target_system);
8719 __tmp.put_u8(self.target_component);
8720 if matches!(version, MavlinkVersion::V2) {
8721 let len = __tmp.len();
8722 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8723 } else {
8724 __tmp.len()
8725 }
8726 }
8727}
8728#[doc = "id: 75"]
8729#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8730#[derive(Debug, Clone, PartialEq)]
8731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8733pub struct COMMAND_INT_DATA {
8734 #[doc = "PARAM1, see MAV_CMD enum"]
8735 pub param1: f32,
8736 #[doc = "PARAM2, see MAV_CMD enum"]
8737 pub param2: f32,
8738 #[doc = "PARAM3, see MAV_CMD enum"]
8739 pub param3: f32,
8740 #[doc = "PARAM4, see MAV_CMD enum"]
8741 pub param4: f32,
8742 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
8743 pub x: i32,
8744 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
8745 pub y: i32,
8746 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
8747 pub z: f32,
8748 #[doc = "The scheduled action for the mission item."]
8749 pub command: MavCmd,
8750 #[doc = "System ID"]
8751 pub target_system: u8,
8752 #[doc = "Component ID"]
8753 pub target_component: u8,
8754 #[doc = "The coordinate system of the COMMAND."]
8755 pub frame: MavFrame,
8756 #[doc = "Not used."]
8757 pub current: u8,
8758 #[doc = "Not used (set 0)."]
8759 pub autocontinue: u8,
8760}
8761impl COMMAND_INT_DATA {
8762 pub const ENCODED_LEN: usize = 35usize;
8763 pub const DEFAULT: Self = Self {
8764 param1: 0.0_f32,
8765 param2: 0.0_f32,
8766 param3: 0.0_f32,
8767 param4: 0.0_f32,
8768 x: 0_i32,
8769 y: 0_i32,
8770 z: 0.0_f32,
8771 command: MavCmd::DEFAULT,
8772 target_system: 0_u8,
8773 target_component: 0_u8,
8774 frame: MavFrame::DEFAULT,
8775 current: 0_u8,
8776 autocontinue: 0_u8,
8777 };
8778 #[cfg(feature = "arbitrary")]
8779 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8780 use arbitrary::{Arbitrary, Unstructured};
8781 let mut buf = [0u8; 1024];
8782 rng.fill_bytes(&mut buf);
8783 let mut unstructured = Unstructured::new(&buf);
8784 Self::arbitrary(&mut unstructured).unwrap_or_default()
8785 }
8786}
8787impl Default for COMMAND_INT_DATA {
8788 fn default() -> Self {
8789 Self::DEFAULT.clone()
8790 }
8791}
8792impl MessageData for COMMAND_INT_DATA {
8793 type Message = MavMessage;
8794 const ID: u32 = 75u32;
8795 const NAME: &'static str = "COMMAND_INT";
8796 const EXTRA_CRC: u8 = 158u8;
8797 const ENCODED_LEN: usize = 35usize;
8798 fn deser(
8799 _version: MavlinkVersion,
8800 __input: &[u8],
8801 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8802 let avail_len = __input.len();
8803 let mut payload_buf = [0; Self::ENCODED_LEN];
8804 let mut buf = if avail_len < Self::ENCODED_LEN {
8805 payload_buf[0..avail_len].copy_from_slice(__input);
8806 Bytes::new(&payload_buf)
8807 } else {
8808 Bytes::new(__input)
8809 };
8810 let mut __struct = Self::default();
8811 __struct.param1 = buf.get_f32_le();
8812 __struct.param2 = buf.get_f32_le();
8813 __struct.param3 = buf.get_f32_le();
8814 __struct.param4 = buf.get_f32_le();
8815 __struct.x = buf.get_i32_le();
8816 __struct.y = buf.get_i32_le();
8817 __struct.z = buf.get_f32_le();
8818 let tmp = buf.get_u16_le();
8819 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8820 ::mavlink_core::error::ParserError::InvalidEnum {
8821 enum_type: "MavCmd",
8822 value: tmp as u32,
8823 },
8824 )?;
8825 __struct.target_system = buf.get_u8();
8826 __struct.target_component = buf.get_u8();
8827 let tmp = buf.get_u8();
8828 __struct.frame =
8829 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8830 enum_type: "MavFrame",
8831 value: tmp as u32,
8832 })?;
8833 __struct.current = buf.get_u8();
8834 __struct.autocontinue = buf.get_u8();
8835 Ok(__struct)
8836 }
8837 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8838 let mut __tmp = BytesMut::new(bytes);
8839 #[allow(clippy::absurd_extreme_comparisons)]
8840 #[allow(unused_comparisons)]
8841 if __tmp.remaining() < Self::ENCODED_LEN {
8842 panic!(
8843 "buffer is too small (need {} bytes, but got {})",
8844 Self::ENCODED_LEN,
8845 __tmp.remaining(),
8846 )
8847 }
8848 __tmp.put_f32_le(self.param1);
8849 __tmp.put_f32_le(self.param2);
8850 __tmp.put_f32_le(self.param3);
8851 __tmp.put_f32_le(self.param4);
8852 __tmp.put_i32_le(self.x);
8853 __tmp.put_i32_le(self.y);
8854 __tmp.put_f32_le(self.z);
8855 __tmp.put_u16_le(self.command as u16);
8856 __tmp.put_u8(self.target_system);
8857 __tmp.put_u8(self.target_component);
8858 __tmp.put_u8(self.frame as u8);
8859 __tmp.put_u8(self.current);
8860 __tmp.put_u8(self.autocontinue);
8861 if matches!(version, MavlinkVersion::V2) {
8862 let len = __tmp.len();
8863 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8864 } else {
8865 __tmp.len()
8866 }
8867 }
8868}
8869#[doc = "id: 76"]
8870#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8871#[derive(Debug, Clone, PartialEq)]
8872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8874pub struct COMMAND_LONG_DATA {
8875 #[doc = "Parameter 1 (for the specific command)."]
8876 pub param1: f32,
8877 #[doc = "Parameter 2 (for the specific command)."]
8878 pub param2: f32,
8879 #[doc = "Parameter 3 (for the specific command)."]
8880 pub param3: f32,
8881 #[doc = "Parameter 4 (for the specific command)."]
8882 pub param4: f32,
8883 #[doc = "Parameter 5 (for the specific command)."]
8884 pub param5: f32,
8885 #[doc = "Parameter 6 (for the specific command)."]
8886 pub param6: f32,
8887 #[doc = "Parameter 7 (for the specific command)."]
8888 pub param7: f32,
8889 #[doc = "Command ID (of command to send)."]
8890 pub command: MavCmd,
8891 #[doc = "System which should execute the command"]
8892 pub target_system: u8,
8893 #[doc = "Component which should execute the command, 0 for all components"]
8894 pub target_component: u8,
8895 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
8896 pub confirmation: u8,
8897}
8898impl COMMAND_LONG_DATA {
8899 pub const ENCODED_LEN: usize = 33usize;
8900 pub const DEFAULT: Self = Self {
8901 param1: 0.0_f32,
8902 param2: 0.0_f32,
8903 param3: 0.0_f32,
8904 param4: 0.0_f32,
8905 param5: 0.0_f32,
8906 param6: 0.0_f32,
8907 param7: 0.0_f32,
8908 command: MavCmd::DEFAULT,
8909 target_system: 0_u8,
8910 target_component: 0_u8,
8911 confirmation: 0_u8,
8912 };
8913 #[cfg(feature = "arbitrary")]
8914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8915 use arbitrary::{Arbitrary, Unstructured};
8916 let mut buf = [0u8; 1024];
8917 rng.fill_bytes(&mut buf);
8918 let mut unstructured = Unstructured::new(&buf);
8919 Self::arbitrary(&mut unstructured).unwrap_or_default()
8920 }
8921}
8922impl Default for COMMAND_LONG_DATA {
8923 fn default() -> Self {
8924 Self::DEFAULT.clone()
8925 }
8926}
8927impl MessageData for COMMAND_LONG_DATA {
8928 type Message = MavMessage;
8929 const ID: u32 = 76u32;
8930 const NAME: &'static str = "COMMAND_LONG";
8931 const EXTRA_CRC: u8 = 152u8;
8932 const ENCODED_LEN: usize = 33usize;
8933 fn deser(
8934 _version: MavlinkVersion,
8935 __input: &[u8],
8936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8937 let avail_len = __input.len();
8938 let mut payload_buf = [0; Self::ENCODED_LEN];
8939 let mut buf = if avail_len < Self::ENCODED_LEN {
8940 payload_buf[0..avail_len].copy_from_slice(__input);
8941 Bytes::new(&payload_buf)
8942 } else {
8943 Bytes::new(__input)
8944 };
8945 let mut __struct = Self::default();
8946 __struct.param1 = buf.get_f32_le();
8947 __struct.param2 = buf.get_f32_le();
8948 __struct.param3 = buf.get_f32_le();
8949 __struct.param4 = buf.get_f32_le();
8950 __struct.param5 = buf.get_f32_le();
8951 __struct.param6 = buf.get_f32_le();
8952 __struct.param7 = buf.get_f32_le();
8953 let tmp = buf.get_u16_le();
8954 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8955 ::mavlink_core::error::ParserError::InvalidEnum {
8956 enum_type: "MavCmd",
8957 value: tmp as u32,
8958 },
8959 )?;
8960 __struct.target_system = buf.get_u8();
8961 __struct.target_component = buf.get_u8();
8962 __struct.confirmation = buf.get_u8();
8963 Ok(__struct)
8964 }
8965 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8966 let mut __tmp = BytesMut::new(bytes);
8967 #[allow(clippy::absurd_extreme_comparisons)]
8968 #[allow(unused_comparisons)]
8969 if __tmp.remaining() < Self::ENCODED_LEN {
8970 panic!(
8971 "buffer is too small (need {} bytes, but got {})",
8972 Self::ENCODED_LEN,
8973 __tmp.remaining(),
8974 )
8975 }
8976 __tmp.put_f32_le(self.param1);
8977 __tmp.put_f32_le(self.param2);
8978 __tmp.put_f32_le(self.param3);
8979 __tmp.put_f32_le(self.param4);
8980 __tmp.put_f32_le(self.param5);
8981 __tmp.put_f32_le(self.param6);
8982 __tmp.put_f32_le(self.param7);
8983 __tmp.put_u16_le(self.command as u16);
8984 __tmp.put_u8(self.target_system);
8985 __tmp.put_u8(self.target_component);
8986 __tmp.put_u8(self.confirmation);
8987 if matches!(version, MavlinkVersion::V2) {
8988 let len = __tmp.len();
8989 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8990 } else {
8991 __tmp.len()
8992 }
8993 }
8994}
8995#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
8996#[doc = "id: 395"]
8997#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
8998#[derive(Debug, Clone, PartialEq)]
8999#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9000#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9001pub struct COMPONENT_INFORMATION_DATA {
9002 #[doc = "Timestamp (time since system boot)."]
9003 pub time_boot_ms: u32,
9004 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9005 pub general_metadata_file_crc: u32,
9006 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9007 pub peripherals_metadata_file_crc: u32,
9008 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9009 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9010 pub general_metadata_uri: [u8; 100],
9011 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9012 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9013 pub peripherals_metadata_uri: [u8; 100],
9014}
9015impl COMPONENT_INFORMATION_DATA {
9016 pub const ENCODED_LEN: usize = 212usize;
9017 pub const DEFAULT: Self = Self {
9018 time_boot_ms: 0_u32,
9019 general_metadata_file_crc: 0_u32,
9020 peripherals_metadata_file_crc: 0_u32,
9021 general_metadata_uri: [0_u8; 100usize],
9022 peripherals_metadata_uri: [0_u8; 100usize],
9023 };
9024 #[cfg(feature = "arbitrary")]
9025 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9026 use arbitrary::{Arbitrary, Unstructured};
9027 let mut buf = [0u8; 1024];
9028 rng.fill_bytes(&mut buf);
9029 let mut unstructured = Unstructured::new(&buf);
9030 Self::arbitrary(&mut unstructured).unwrap_or_default()
9031 }
9032}
9033impl Default for COMPONENT_INFORMATION_DATA {
9034 fn default() -> Self {
9035 Self::DEFAULT.clone()
9036 }
9037}
9038impl MessageData for COMPONENT_INFORMATION_DATA {
9039 type Message = MavMessage;
9040 const ID: u32 = 395u32;
9041 const NAME: &'static str = "COMPONENT_INFORMATION";
9042 const EXTRA_CRC: u8 = 0u8;
9043 const ENCODED_LEN: usize = 212usize;
9044 fn deser(
9045 _version: MavlinkVersion,
9046 __input: &[u8],
9047 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9048 let avail_len = __input.len();
9049 let mut payload_buf = [0; Self::ENCODED_LEN];
9050 let mut buf = if avail_len < Self::ENCODED_LEN {
9051 payload_buf[0..avail_len].copy_from_slice(__input);
9052 Bytes::new(&payload_buf)
9053 } else {
9054 Bytes::new(__input)
9055 };
9056 let mut __struct = Self::default();
9057 __struct.time_boot_ms = buf.get_u32_le();
9058 __struct.general_metadata_file_crc = buf.get_u32_le();
9059 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9060 for v in &mut __struct.general_metadata_uri {
9061 let val = buf.get_u8();
9062 *v = val;
9063 }
9064 for v in &mut __struct.peripherals_metadata_uri {
9065 let val = buf.get_u8();
9066 *v = val;
9067 }
9068 Ok(__struct)
9069 }
9070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9071 let mut __tmp = BytesMut::new(bytes);
9072 #[allow(clippy::absurd_extreme_comparisons)]
9073 #[allow(unused_comparisons)]
9074 if __tmp.remaining() < Self::ENCODED_LEN {
9075 panic!(
9076 "buffer is too small (need {} bytes, but got {})",
9077 Self::ENCODED_LEN,
9078 __tmp.remaining(),
9079 )
9080 }
9081 __tmp.put_u32_le(self.time_boot_ms);
9082 __tmp.put_u32_le(self.general_metadata_file_crc);
9083 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9084 for val in &self.general_metadata_uri {
9085 __tmp.put_u8(*val);
9086 }
9087 for val in &self.peripherals_metadata_uri {
9088 __tmp.put_u8(*val);
9089 }
9090 if matches!(version, MavlinkVersion::V2) {
9091 let len = __tmp.len();
9092 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9093 } else {
9094 __tmp.len()
9095 }
9096 }
9097}
9098#[doc = "id: 396"]
9099#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9100#[derive(Debug, Clone, PartialEq)]
9101#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9103pub struct COMPONENT_INFORMATION_BASIC_DATA {
9104 #[doc = "Component capability flags"]
9105 pub capabilities: MavProtocolCapability,
9106 #[doc = "Timestamp (time since system boot)."]
9107 pub time_boot_ms: u32,
9108 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9109 pub time_manufacture_s: u32,
9110 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9111 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9112 pub vendor_name: [u8; 32],
9113 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9114 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9115 pub model_name: [u8; 32],
9116 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9117 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9118 pub software_version: [u8; 24],
9119 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9120 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9121 pub hardware_version: [u8; 24],
9122 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9123 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9124 pub serial_number: [u8; 32],
9125}
9126impl COMPONENT_INFORMATION_BASIC_DATA {
9127 pub const ENCODED_LEN: usize = 160usize;
9128 pub const DEFAULT: Self = Self {
9129 capabilities: MavProtocolCapability::DEFAULT,
9130 time_boot_ms: 0_u32,
9131 time_manufacture_s: 0_u32,
9132 vendor_name: [0_u8; 32usize],
9133 model_name: [0_u8; 32usize],
9134 software_version: [0_u8; 24usize],
9135 hardware_version: [0_u8; 24usize],
9136 serial_number: [0_u8; 32usize],
9137 };
9138 #[cfg(feature = "arbitrary")]
9139 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9140 use arbitrary::{Arbitrary, Unstructured};
9141 let mut buf = [0u8; 1024];
9142 rng.fill_bytes(&mut buf);
9143 let mut unstructured = Unstructured::new(&buf);
9144 Self::arbitrary(&mut unstructured).unwrap_or_default()
9145 }
9146}
9147impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9148 fn default() -> Self {
9149 Self::DEFAULT.clone()
9150 }
9151}
9152impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9153 type Message = MavMessage;
9154 const ID: u32 = 396u32;
9155 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9156 const EXTRA_CRC: u8 = 50u8;
9157 const ENCODED_LEN: usize = 160usize;
9158 fn deser(
9159 _version: MavlinkVersion,
9160 __input: &[u8],
9161 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9162 let avail_len = __input.len();
9163 let mut payload_buf = [0; Self::ENCODED_LEN];
9164 let mut buf = if avail_len < Self::ENCODED_LEN {
9165 payload_buf[0..avail_len].copy_from_slice(__input);
9166 Bytes::new(&payload_buf)
9167 } else {
9168 Bytes::new(__input)
9169 };
9170 let mut __struct = Self::default();
9171 let tmp = buf.get_u64_le();
9172 __struct.capabilities = MavProtocolCapability::from_bits(
9173 tmp & MavProtocolCapability::all().bits(),
9174 )
9175 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9176 flag_type: "MavProtocolCapability",
9177 value: tmp as u32,
9178 })?;
9179 __struct.time_boot_ms = buf.get_u32_le();
9180 __struct.time_manufacture_s = buf.get_u32_le();
9181 for v in &mut __struct.vendor_name {
9182 let val = buf.get_u8();
9183 *v = val;
9184 }
9185 for v in &mut __struct.model_name {
9186 let val = buf.get_u8();
9187 *v = val;
9188 }
9189 for v in &mut __struct.software_version {
9190 let val = buf.get_u8();
9191 *v = val;
9192 }
9193 for v in &mut __struct.hardware_version {
9194 let val = buf.get_u8();
9195 *v = val;
9196 }
9197 for v in &mut __struct.serial_number {
9198 let val = buf.get_u8();
9199 *v = val;
9200 }
9201 Ok(__struct)
9202 }
9203 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9204 let mut __tmp = BytesMut::new(bytes);
9205 #[allow(clippy::absurd_extreme_comparisons)]
9206 #[allow(unused_comparisons)]
9207 if __tmp.remaining() < Self::ENCODED_LEN {
9208 panic!(
9209 "buffer is too small (need {} bytes, but got {})",
9210 Self::ENCODED_LEN,
9211 __tmp.remaining(),
9212 )
9213 }
9214 __tmp.put_u64_le(self.capabilities.bits());
9215 __tmp.put_u32_le(self.time_boot_ms);
9216 __tmp.put_u32_le(self.time_manufacture_s);
9217 for val in &self.vendor_name {
9218 __tmp.put_u8(*val);
9219 }
9220 for val in &self.model_name {
9221 __tmp.put_u8(*val);
9222 }
9223 for val in &self.software_version {
9224 __tmp.put_u8(*val);
9225 }
9226 for val in &self.hardware_version {
9227 __tmp.put_u8(*val);
9228 }
9229 for val in &self.serial_number {
9230 __tmp.put_u8(*val);
9231 }
9232 if matches!(version, MavlinkVersion::V2) {
9233 let len = __tmp.len();
9234 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9235 } else {
9236 __tmp.len()
9237 }
9238 }
9239}
9240#[doc = "id: 397"]
9241#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9242#[derive(Debug, Clone, PartialEq)]
9243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9245pub struct COMPONENT_METADATA_DATA {
9246 #[doc = "Timestamp (time since system boot)."]
9247 pub time_boot_ms: u32,
9248 #[doc = "CRC32 of the general metadata file."]
9249 pub file_crc: u32,
9250 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9251 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9252 pub uri: [u8; 100],
9253}
9254impl COMPONENT_METADATA_DATA {
9255 pub const ENCODED_LEN: usize = 108usize;
9256 pub const DEFAULT: Self = Self {
9257 time_boot_ms: 0_u32,
9258 file_crc: 0_u32,
9259 uri: [0_u8; 100usize],
9260 };
9261 #[cfg(feature = "arbitrary")]
9262 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9263 use arbitrary::{Arbitrary, Unstructured};
9264 let mut buf = [0u8; 1024];
9265 rng.fill_bytes(&mut buf);
9266 let mut unstructured = Unstructured::new(&buf);
9267 Self::arbitrary(&mut unstructured).unwrap_or_default()
9268 }
9269}
9270impl Default for COMPONENT_METADATA_DATA {
9271 fn default() -> Self {
9272 Self::DEFAULT.clone()
9273 }
9274}
9275impl MessageData for COMPONENT_METADATA_DATA {
9276 type Message = MavMessage;
9277 const ID: u32 = 397u32;
9278 const NAME: &'static str = "COMPONENT_METADATA";
9279 const EXTRA_CRC: u8 = 182u8;
9280 const ENCODED_LEN: usize = 108usize;
9281 fn deser(
9282 _version: MavlinkVersion,
9283 __input: &[u8],
9284 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9285 let avail_len = __input.len();
9286 let mut payload_buf = [0; Self::ENCODED_LEN];
9287 let mut buf = if avail_len < Self::ENCODED_LEN {
9288 payload_buf[0..avail_len].copy_from_slice(__input);
9289 Bytes::new(&payload_buf)
9290 } else {
9291 Bytes::new(__input)
9292 };
9293 let mut __struct = Self::default();
9294 __struct.time_boot_ms = buf.get_u32_le();
9295 __struct.file_crc = buf.get_u32_le();
9296 for v in &mut __struct.uri {
9297 let val = buf.get_u8();
9298 *v = val;
9299 }
9300 Ok(__struct)
9301 }
9302 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9303 let mut __tmp = BytesMut::new(bytes);
9304 #[allow(clippy::absurd_extreme_comparisons)]
9305 #[allow(unused_comparisons)]
9306 if __tmp.remaining() < Self::ENCODED_LEN {
9307 panic!(
9308 "buffer is too small (need {} bytes, but got {})",
9309 Self::ENCODED_LEN,
9310 __tmp.remaining(),
9311 )
9312 }
9313 __tmp.put_u32_le(self.time_boot_ms);
9314 __tmp.put_u32_le(self.file_crc);
9315 for val in &self.uri {
9316 __tmp.put_u8(*val);
9317 }
9318 if matches!(version, MavlinkVersion::V2) {
9319 let len = __tmp.len();
9320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9321 } else {
9322 __tmp.len()
9323 }
9324 }
9325}
9326#[doc = "id: 146"]
9327#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9328#[derive(Debug, Clone, PartialEq)]
9329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9331pub struct CONTROL_SYSTEM_STATE_DATA {
9332 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9333 pub time_usec: u64,
9334 #[doc = "X acceleration in body frame"]
9335 pub x_acc: f32,
9336 #[doc = "Y acceleration in body frame"]
9337 pub y_acc: f32,
9338 #[doc = "Z acceleration in body frame"]
9339 pub z_acc: f32,
9340 #[doc = "X velocity in body frame"]
9341 pub x_vel: f32,
9342 #[doc = "Y velocity in body frame"]
9343 pub y_vel: f32,
9344 #[doc = "Z velocity in body frame"]
9345 pub z_vel: f32,
9346 #[doc = "X position in local frame"]
9347 pub x_pos: f32,
9348 #[doc = "Y position in local frame"]
9349 pub y_pos: f32,
9350 #[doc = "Z position in local frame"]
9351 pub z_pos: f32,
9352 #[doc = "Airspeed, set to -1 if unknown"]
9353 pub airspeed: f32,
9354 #[doc = "Variance of body velocity estimate"]
9355 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9356 pub vel_variance: [f32; 3],
9357 #[doc = "Variance in local position"]
9358 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9359 pub pos_variance: [f32; 3],
9360 #[doc = "The attitude, represented as Quaternion"]
9361 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9362 pub q: [f32; 4],
9363 #[doc = "Angular rate in roll axis"]
9364 pub roll_rate: f32,
9365 #[doc = "Angular rate in pitch axis"]
9366 pub pitch_rate: f32,
9367 #[doc = "Angular rate in yaw axis"]
9368 pub yaw_rate: f32,
9369}
9370impl CONTROL_SYSTEM_STATE_DATA {
9371 pub const ENCODED_LEN: usize = 100usize;
9372 pub const DEFAULT: Self = Self {
9373 time_usec: 0_u64,
9374 x_acc: 0.0_f32,
9375 y_acc: 0.0_f32,
9376 z_acc: 0.0_f32,
9377 x_vel: 0.0_f32,
9378 y_vel: 0.0_f32,
9379 z_vel: 0.0_f32,
9380 x_pos: 0.0_f32,
9381 y_pos: 0.0_f32,
9382 z_pos: 0.0_f32,
9383 airspeed: 0.0_f32,
9384 vel_variance: [0.0_f32; 3usize],
9385 pos_variance: [0.0_f32; 3usize],
9386 q: [0.0_f32; 4usize],
9387 roll_rate: 0.0_f32,
9388 pitch_rate: 0.0_f32,
9389 yaw_rate: 0.0_f32,
9390 };
9391 #[cfg(feature = "arbitrary")]
9392 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9393 use arbitrary::{Arbitrary, Unstructured};
9394 let mut buf = [0u8; 1024];
9395 rng.fill_bytes(&mut buf);
9396 let mut unstructured = Unstructured::new(&buf);
9397 Self::arbitrary(&mut unstructured).unwrap_or_default()
9398 }
9399}
9400impl Default for CONTROL_SYSTEM_STATE_DATA {
9401 fn default() -> Self {
9402 Self::DEFAULT.clone()
9403 }
9404}
9405impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9406 type Message = MavMessage;
9407 const ID: u32 = 146u32;
9408 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9409 const EXTRA_CRC: u8 = 103u8;
9410 const ENCODED_LEN: usize = 100usize;
9411 fn deser(
9412 _version: MavlinkVersion,
9413 __input: &[u8],
9414 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9415 let avail_len = __input.len();
9416 let mut payload_buf = [0; Self::ENCODED_LEN];
9417 let mut buf = if avail_len < Self::ENCODED_LEN {
9418 payload_buf[0..avail_len].copy_from_slice(__input);
9419 Bytes::new(&payload_buf)
9420 } else {
9421 Bytes::new(__input)
9422 };
9423 let mut __struct = Self::default();
9424 __struct.time_usec = buf.get_u64_le();
9425 __struct.x_acc = buf.get_f32_le();
9426 __struct.y_acc = buf.get_f32_le();
9427 __struct.z_acc = buf.get_f32_le();
9428 __struct.x_vel = buf.get_f32_le();
9429 __struct.y_vel = buf.get_f32_le();
9430 __struct.z_vel = buf.get_f32_le();
9431 __struct.x_pos = buf.get_f32_le();
9432 __struct.y_pos = buf.get_f32_le();
9433 __struct.z_pos = buf.get_f32_le();
9434 __struct.airspeed = buf.get_f32_le();
9435 for v in &mut __struct.vel_variance {
9436 let val = buf.get_f32_le();
9437 *v = val;
9438 }
9439 for v in &mut __struct.pos_variance {
9440 let val = buf.get_f32_le();
9441 *v = val;
9442 }
9443 for v in &mut __struct.q {
9444 let val = buf.get_f32_le();
9445 *v = val;
9446 }
9447 __struct.roll_rate = buf.get_f32_le();
9448 __struct.pitch_rate = buf.get_f32_le();
9449 __struct.yaw_rate = buf.get_f32_le();
9450 Ok(__struct)
9451 }
9452 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9453 let mut __tmp = BytesMut::new(bytes);
9454 #[allow(clippy::absurd_extreme_comparisons)]
9455 #[allow(unused_comparisons)]
9456 if __tmp.remaining() < Self::ENCODED_LEN {
9457 panic!(
9458 "buffer is too small (need {} bytes, but got {})",
9459 Self::ENCODED_LEN,
9460 __tmp.remaining(),
9461 )
9462 }
9463 __tmp.put_u64_le(self.time_usec);
9464 __tmp.put_f32_le(self.x_acc);
9465 __tmp.put_f32_le(self.y_acc);
9466 __tmp.put_f32_le(self.z_acc);
9467 __tmp.put_f32_le(self.x_vel);
9468 __tmp.put_f32_le(self.y_vel);
9469 __tmp.put_f32_le(self.z_vel);
9470 __tmp.put_f32_le(self.x_pos);
9471 __tmp.put_f32_le(self.y_pos);
9472 __tmp.put_f32_le(self.z_pos);
9473 __tmp.put_f32_le(self.airspeed);
9474 for val in &self.vel_variance {
9475 __tmp.put_f32_le(*val);
9476 }
9477 for val in &self.pos_variance {
9478 __tmp.put_f32_le(*val);
9479 }
9480 for val in &self.q {
9481 __tmp.put_f32_le(*val);
9482 }
9483 __tmp.put_f32_le(self.roll_rate);
9484 __tmp.put_f32_le(self.pitch_rate);
9485 __tmp.put_f32_le(self.yaw_rate);
9486 if matches!(version, MavlinkVersion::V2) {
9487 let len = __tmp.len();
9488 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9489 } else {
9490 __tmp.len()
9491 }
9492 }
9493}
9494#[doc = "id: 411"]
9495#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9496#[derive(Debug, Clone, PartialEq)]
9497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9499pub struct CURRENT_EVENT_SEQUENCE_DATA {
9500 #[doc = "Sequence number."]
9501 pub sequence: u16,
9502 #[doc = "Flag bitset."]
9503 pub flags: MavEventCurrentSequenceFlags,
9504}
9505impl CURRENT_EVENT_SEQUENCE_DATA {
9506 pub const ENCODED_LEN: usize = 3usize;
9507 pub const DEFAULT: Self = Self {
9508 sequence: 0_u16,
9509 flags: MavEventCurrentSequenceFlags::DEFAULT,
9510 };
9511 #[cfg(feature = "arbitrary")]
9512 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9513 use arbitrary::{Arbitrary, Unstructured};
9514 let mut buf = [0u8; 1024];
9515 rng.fill_bytes(&mut buf);
9516 let mut unstructured = Unstructured::new(&buf);
9517 Self::arbitrary(&mut unstructured).unwrap_or_default()
9518 }
9519}
9520impl Default for CURRENT_EVENT_SEQUENCE_DATA {
9521 fn default() -> Self {
9522 Self::DEFAULT.clone()
9523 }
9524}
9525impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
9526 type Message = MavMessage;
9527 const ID: u32 = 411u32;
9528 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
9529 const EXTRA_CRC: u8 = 106u8;
9530 const ENCODED_LEN: usize = 3usize;
9531 fn deser(
9532 _version: MavlinkVersion,
9533 __input: &[u8],
9534 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9535 let avail_len = __input.len();
9536 let mut payload_buf = [0; Self::ENCODED_LEN];
9537 let mut buf = if avail_len < Self::ENCODED_LEN {
9538 payload_buf[0..avail_len].copy_from_slice(__input);
9539 Bytes::new(&payload_buf)
9540 } else {
9541 Bytes::new(__input)
9542 };
9543 let mut __struct = Self::default();
9544 __struct.sequence = buf.get_u16_le();
9545 let tmp = buf.get_u8();
9546 __struct.flags =
9547 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9548 enum_type: "MavEventCurrentSequenceFlags",
9549 value: tmp as u32,
9550 })?;
9551 Ok(__struct)
9552 }
9553 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9554 let mut __tmp = BytesMut::new(bytes);
9555 #[allow(clippy::absurd_extreme_comparisons)]
9556 #[allow(unused_comparisons)]
9557 if __tmp.remaining() < Self::ENCODED_LEN {
9558 panic!(
9559 "buffer is too small (need {} bytes, but got {})",
9560 Self::ENCODED_LEN,
9561 __tmp.remaining(),
9562 )
9563 }
9564 __tmp.put_u16_le(self.sequence);
9565 __tmp.put_u8(self.flags as u8);
9566 if matches!(version, MavlinkVersion::V2) {
9567 let len = __tmp.len();
9568 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9569 } else {
9570 __tmp.len()
9571 }
9572 }
9573}
9574#[doc = "id: 436"]
9575#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
9576#[derive(Debug, Clone, PartialEq)]
9577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9578#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9579pub struct CURRENT_MODE_DATA {
9580 #[doc = "A bitfield for use for autopilot-specific flags"]
9581 pub custom_mode: u32,
9582 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
9583 pub intended_custom_mode: u32,
9584 #[doc = "Standard mode."]
9585 pub standard_mode: MavStandardMode,
9586}
9587impl CURRENT_MODE_DATA {
9588 pub const ENCODED_LEN: usize = 9usize;
9589 pub const DEFAULT: Self = Self {
9590 custom_mode: 0_u32,
9591 intended_custom_mode: 0_u32,
9592 standard_mode: MavStandardMode::DEFAULT,
9593 };
9594 #[cfg(feature = "arbitrary")]
9595 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9596 use arbitrary::{Arbitrary, Unstructured};
9597 let mut buf = [0u8; 1024];
9598 rng.fill_bytes(&mut buf);
9599 let mut unstructured = Unstructured::new(&buf);
9600 Self::arbitrary(&mut unstructured).unwrap_or_default()
9601 }
9602}
9603impl Default for CURRENT_MODE_DATA {
9604 fn default() -> Self {
9605 Self::DEFAULT.clone()
9606 }
9607}
9608impl MessageData for CURRENT_MODE_DATA {
9609 type Message = MavMessage;
9610 const ID: u32 = 436u32;
9611 const NAME: &'static str = "CURRENT_MODE";
9612 const EXTRA_CRC: u8 = 193u8;
9613 const ENCODED_LEN: usize = 9usize;
9614 fn deser(
9615 _version: MavlinkVersion,
9616 __input: &[u8],
9617 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9618 let avail_len = __input.len();
9619 let mut payload_buf = [0; Self::ENCODED_LEN];
9620 let mut buf = if avail_len < Self::ENCODED_LEN {
9621 payload_buf[0..avail_len].copy_from_slice(__input);
9622 Bytes::new(&payload_buf)
9623 } else {
9624 Bytes::new(__input)
9625 };
9626 let mut __struct = Self::default();
9627 __struct.custom_mode = buf.get_u32_le();
9628 __struct.intended_custom_mode = buf.get_u32_le();
9629 let tmp = buf.get_u8();
9630 __struct.standard_mode =
9631 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9632 enum_type: "MavStandardMode",
9633 value: tmp as u32,
9634 })?;
9635 Ok(__struct)
9636 }
9637 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9638 let mut __tmp = BytesMut::new(bytes);
9639 #[allow(clippy::absurd_extreme_comparisons)]
9640 #[allow(unused_comparisons)]
9641 if __tmp.remaining() < Self::ENCODED_LEN {
9642 panic!(
9643 "buffer is too small (need {} bytes, but got {})",
9644 Self::ENCODED_LEN,
9645 __tmp.remaining(),
9646 )
9647 }
9648 __tmp.put_u32_le(self.custom_mode);
9649 __tmp.put_u32_le(self.intended_custom_mode);
9650 __tmp.put_u8(self.standard_mode as u8);
9651 if matches!(version, MavlinkVersion::V2) {
9652 let len = __tmp.len();
9653 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9654 } else {
9655 __tmp.len()
9656 }
9657 }
9658}
9659#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
9660#[doc = "id: 67"]
9661#[doc = "Data stream status information."]
9662#[derive(Debug, Clone, PartialEq)]
9663#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9664#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9665pub struct DATA_STREAM_DATA {
9666 #[doc = "The message rate"]
9667 pub message_rate: u16,
9668 #[doc = "The ID of the requested data stream"]
9669 pub stream_id: u8,
9670 #[doc = "1 stream is enabled, 0 stream is stopped."]
9671 pub on_off: u8,
9672}
9673impl DATA_STREAM_DATA {
9674 pub const ENCODED_LEN: usize = 4usize;
9675 pub const DEFAULT: Self = Self {
9676 message_rate: 0_u16,
9677 stream_id: 0_u8,
9678 on_off: 0_u8,
9679 };
9680 #[cfg(feature = "arbitrary")]
9681 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9682 use arbitrary::{Arbitrary, Unstructured};
9683 let mut buf = [0u8; 1024];
9684 rng.fill_bytes(&mut buf);
9685 let mut unstructured = Unstructured::new(&buf);
9686 Self::arbitrary(&mut unstructured).unwrap_or_default()
9687 }
9688}
9689impl Default for DATA_STREAM_DATA {
9690 fn default() -> Self {
9691 Self::DEFAULT.clone()
9692 }
9693}
9694impl MessageData for DATA_STREAM_DATA {
9695 type Message = MavMessage;
9696 const ID: u32 = 67u32;
9697 const NAME: &'static str = "DATA_STREAM";
9698 const EXTRA_CRC: u8 = 21u8;
9699 const ENCODED_LEN: usize = 4usize;
9700 fn deser(
9701 _version: MavlinkVersion,
9702 __input: &[u8],
9703 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9704 let avail_len = __input.len();
9705 let mut payload_buf = [0; Self::ENCODED_LEN];
9706 let mut buf = if avail_len < Self::ENCODED_LEN {
9707 payload_buf[0..avail_len].copy_from_slice(__input);
9708 Bytes::new(&payload_buf)
9709 } else {
9710 Bytes::new(__input)
9711 };
9712 let mut __struct = Self::default();
9713 __struct.message_rate = buf.get_u16_le();
9714 __struct.stream_id = buf.get_u8();
9715 __struct.on_off = buf.get_u8();
9716 Ok(__struct)
9717 }
9718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9719 let mut __tmp = BytesMut::new(bytes);
9720 #[allow(clippy::absurd_extreme_comparisons)]
9721 #[allow(unused_comparisons)]
9722 if __tmp.remaining() < Self::ENCODED_LEN {
9723 panic!(
9724 "buffer is too small (need {} bytes, but got {})",
9725 Self::ENCODED_LEN,
9726 __tmp.remaining(),
9727 )
9728 }
9729 __tmp.put_u16_le(self.message_rate);
9730 __tmp.put_u8(self.stream_id);
9731 __tmp.put_u8(self.on_off);
9732 if matches!(version, MavlinkVersion::V2) {
9733 let len = __tmp.len();
9734 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9735 } else {
9736 __tmp.len()
9737 }
9738 }
9739}
9740#[doc = "id: 130"]
9741#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
9742#[derive(Debug, Clone, PartialEq)]
9743#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9744#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9745pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
9746 #[doc = "total data size (set on ACK only)."]
9747 pub size: u32,
9748 #[doc = "Width of a matrix or image."]
9749 pub width: u16,
9750 #[doc = "Height of a matrix or image."]
9751 pub height: u16,
9752 #[doc = "Number of packets being sent (set on ACK only)."]
9753 pub packets: u16,
9754 #[doc = "Type of requested/acknowledged data."]
9755 pub mavtype: MavlinkDataStreamType,
9756 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
9757 pub payload: u8,
9758 #[doc = "JPEG quality. Values: [1-100]."]
9759 pub jpg_quality: u8,
9760}
9761impl DATA_TRANSMISSION_HANDSHAKE_DATA {
9762 pub const ENCODED_LEN: usize = 13usize;
9763 pub const DEFAULT: Self = Self {
9764 size: 0_u32,
9765 width: 0_u16,
9766 height: 0_u16,
9767 packets: 0_u16,
9768 mavtype: MavlinkDataStreamType::DEFAULT,
9769 payload: 0_u8,
9770 jpg_quality: 0_u8,
9771 };
9772 #[cfg(feature = "arbitrary")]
9773 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9774 use arbitrary::{Arbitrary, Unstructured};
9775 let mut buf = [0u8; 1024];
9776 rng.fill_bytes(&mut buf);
9777 let mut unstructured = Unstructured::new(&buf);
9778 Self::arbitrary(&mut unstructured).unwrap_or_default()
9779 }
9780}
9781impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
9782 fn default() -> Self {
9783 Self::DEFAULT.clone()
9784 }
9785}
9786impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
9787 type Message = MavMessage;
9788 const ID: u32 = 130u32;
9789 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
9790 const EXTRA_CRC: u8 = 29u8;
9791 const ENCODED_LEN: usize = 13usize;
9792 fn deser(
9793 _version: MavlinkVersion,
9794 __input: &[u8],
9795 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9796 let avail_len = __input.len();
9797 let mut payload_buf = [0; Self::ENCODED_LEN];
9798 let mut buf = if avail_len < Self::ENCODED_LEN {
9799 payload_buf[0..avail_len].copy_from_slice(__input);
9800 Bytes::new(&payload_buf)
9801 } else {
9802 Bytes::new(__input)
9803 };
9804 let mut __struct = Self::default();
9805 __struct.size = buf.get_u32_le();
9806 __struct.width = buf.get_u16_le();
9807 __struct.height = buf.get_u16_le();
9808 __struct.packets = buf.get_u16_le();
9809 let tmp = buf.get_u8();
9810 __struct.mavtype =
9811 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9812 enum_type: "MavlinkDataStreamType",
9813 value: tmp as u32,
9814 })?;
9815 __struct.payload = buf.get_u8();
9816 __struct.jpg_quality = buf.get_u8();
9817 Ok(__struct)
9818 }
9819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9820 let mut __tmp = BytesMut::new(bytes);
9821 #[allow(clippy::absurd_extreme_comparisons)]
9822 #[allow(unused_comparisons)]
9823 if __tmp.remaining() < Self::ENCODED_LEN {
9824 panic!(
9825 "buffer is too small (need {} bytes, but got {})",
9826 Self::ENCODED_LEN,
9827 __tmp.remaining(),
9828 )
9829 }
9830 __tmp.put_u32_le(self.size);
9831 __tmp.put_u16_le(self.width);
9832 __tmp.put_u16_le(self.height);
9833 __tmp.put_u16_le(self.packets);
9834 __tmp.put_u8(self.mavtype as u8);
9835 __tmp.put_u8(self.payload);
9836 __tmp.put_u8(self.jpg_quality);
9837 if matches!(version, MavlinkVersion::V2) {
9838 let len = __tmp.len();
9839 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9840 } else {
9841 __tmp.len()
9842 }
9843 }
9844}
9845#[doc = "id: 254"]
9846#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
9847#[derive(Debug, Clone, PartialEq)]
9848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9850pub struct DEBUG_DATA {
9851 #[doc = "Timestamp (time since system boot)."]
9852 pub time_boot_ms: u32,
9853 #[doc = "DEBUG value"]
9854 pub value: f32,
9855 #[doc = "index of debug variable"]
9856 pub ind: u8,
9857}
9858impl DEBUG_DATA {
9859 pub const ENCODED_LEN: usize = 9usize;
9860 pub const DEFAULT: Self = Self {
9861 time_boot_ms: 0_u32,
9862 value: 0.0_f32,
9863 ind: 0_u8,
9864 };
9865 #[cfg(feature = "arbitrary")]
9866 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9867 use arbitrary::{Arbitrary, Unstructured};
9868 let mut buf = [0u8; 1024];
9869 rng.fill_bytes(&mut buf);
9870 let mut unstructured = Unstructured::new(&buf);
9871 Self::arbitrary(&mut unstructured).unwrap_or_default()
9872 }
9873}
9874impl Default for DEBUG_DATA {
9875 fn default() -> Self {
9876 Self::DEFAULT.clone()
9877 }
9878}
9879impl MessageData for DEBUG_DATA {
9880 type Message = MavMessage;
9881 const ID: u32 = 254u32;
9882 const NAME: &'static str = "DEBUG";
9883 const EXTRA_CRC: u8 = 46u8;
9884 const ENCODED_LEN: usize = 9usize;
9885 fn deser(
9886 _version: MavlinkVersion,
9887 __input: &[u8],
9888 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9889 let avail_len = __input.len();
9890 let mut payload_buf = [0; Self::ENCODED_LEN];
9891 let mut buf = if avail_len < Self::ENCODED_LEN {
9892 payload_buf[0..avail_len].copy_from_slice(__input);
9893 Bytes::new(&payload_buf)
9894 } else {
9895 Bytes::new(__input)
9896 };
9897 let mut __struct = Self::default();
9898 __struct.time_boot_ms = buf.get_u32_le();
9899 __struct.value = buf.get_f32_le();
9900 __struct.ind = buf.get_u8();
9901 Ok(__struct)
9902 }
9903 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9904 let mut __tmp = BytesMut::new(bytes);
9905 #[allow(clippy::absurd_extreme_comparisons)]
9906 #[allow(unused_comparisons)]
9907 if __tmp.remaining() < Self::ENCODED_LEN {
9908 panic!(
9909 "buffer is too small (need {} bytes, but got {})",
9910 Self::ENCODED_LEN,
9911 __tmp.remaining(),
9912 )
9913 }
9914 __tmp.put_u32_le(self.time_boot_ms);
9915 __tmp.put_f32_le(self.value);
9916 __tmp.put_u8(self.ind);
9917 if matches!(version, MavlinkVersion::V2) {
9918 let len = __tmp.len();
9919 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9920 } else {
9921 __tmp.len()
9922 }
9923 }
9924}
9925#[doc = "id: 350"]
9926#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
9927#[derive(Debug, Clone, PartialEq)]
9928#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9929#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9930pub struct DEBUG_FLOAT_ARRAY_DATA {
9931 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9932 pub time_usec: u64,
9933 #[doc = "Unique ID used to discriminate between arrays"]
9934 pub array_id: u16,
9935 #[doc = "Name, for human-friendly display in a Ground Control Station"]
9936 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9937 pub name: [u8; 10],
9938 #[doc = "data"]
9939 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9940 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9941 pub data: [f32; 58],
9942}
9943impl DEBUG_FLOAT_ARRAY_DATA {
9944 pub const ENCODED_LEN: usize = 252usize;
9945 pub const DEFAULT: Self = Self {
9946 time_usec: 0_u64,
9947 array_id: 0_u16,
9948 name: [0_u8; 10usize],
9949 data: [0.0_f32; 58usize],
9950 };
9951 #[cfg(feature = "arbitrary")]
9952 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9953 use arbitrary::{Arbitrary, Unstructured};
9954 let mut buf = [0u8; 1024];
9955 rng.fill_bytes(&mut buf);
9956 let mut unstructured = Unstructured::new(&buf);
9957 Self::arbitrary(&mut unstructured).unwrap_or_default()
9958 }
9959}
9960impl Default for DEBUG_FLOAT_ARRAY_DATA {
9961 fn default() -> Self {
9962 Self::DEFAULT.clone()
9963 }
9964}
9965impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
9966 type Message = MavMessage;
9967 const ID: u32 = 350u32;
9968 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
9969 const EXTRA_CRC: u8 = 232u8;
9970 const ENCODED_LEN: usize = 252usize;
9971 fn deser(
9972 _version: MavlinkVersion,
9973 __input: &[u8],
9974 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9975 let avail_len = __input.len();
9976 let mut payload_buf = [0; Self::ENCODED_LEN];
9977 let mut buf = if avail_len < Self::ENCODED_LEN {
9978 payload_buf[0..avail_len].copy_from_slice(__input);
9979 Bytes::new(&payload_buf)
9980 } else {
9981 Bytes::new(__input)
9982 };
9983 let mut __struct = Self::default();
9984 __struct.time_usec = buf.get_u64_le();
9985 __struct.array_id = buf.get_u16_le();
9986 for v in &mut __struct.name {
9987 let val = buf.get_u8();
9988 *v = val;
9989 }
9990 for v in &mut __struct.data {
9991 let val = buf.get_f32_le();
9992 *v = val;
9993 }
9994 Ok(__struct)
9995 }
9996 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9997 let mut __tmp = BytesMut::new(bytes);
9998 #[allow(clippy::absurd_extreme_comparisons)]
9999 #[allow(unused_comparisons)]
10000 if __tmp.remaining() < Self::ENCODED_LEN {
10001 panic!(
10002 "buffer is too small (need {} bytes, but got {})",
10003 Self::ENCODED_LEN,
10004 __tmp.remaining(),
10005 )
10006 }
10007 __tmp.put_u64_le(self.time_usec);
10008 __tmp.put_u16_le(self.array_id);
10009 for val in &self.name {
10010 __tmp.put_u8(*val);
10011 }
10012 for val in &self.data {
10013 __tmp.put_f32_le(*val);
10014 }
10015 if matches!(version, MavlinkVersion::V2) {
10016 let len = __tmp.len();
10017 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10018 } else {
10019 __tmp.len()
10020 }
10021 }
10022}
10023#[doc = "id: 250"]
10024#[doc = "To debug something using a named 3D vector."]
10025#[derive(Debug, Clone, PartialEq)]
10026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10028pub struct DEBUG_VECT_DATA {
10029 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10030 pub time_usec: u64,
10031 #[doc = "x"]
10032 pub x: f32,
10033 #[doc = "y"]
10034 pub y: f32,
10035 #[doc = "z"]
10036 pub z: f32,
10037 #[doc = "Name"]
10038 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10039 pub name: [u8; 10],
10040}
10041impl DEBUG_VECT_DATA {
10042 pub const ENCODED_LEN: usize = 30usize;
10043 pub const DEFAULT: Self = Self {
10044 time_usec: 0_u64,
10045 x: 0.0_f32,
10046 y: 0.0_f32,
10047 z: 0.0_f32,
10048 name: [0_u8; 10usize],
10049 };
10050 #[cfg(feature = "arbitrary")]
10051 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10052 use arbitrary::{Arbitrary, Unstructured};
10053 let mut buf = [0u8; 1024];
10054 rng.fill_bytes(&mut buf);
10055 let mut unstructured = Unstructured::new(&buf);
10056 Self::arbitrary(&mut unstructured).unwrap_or_default()
10057 }
10058}
10059impl Default for DEBUG_VECT_DATA {
10060 fn default() -> Self {
10061 Self::DEFAULT.clone()
10062 }
10063}
10064impl MessageData for DEBUG_VECT_DATA {
10065 type Message = MavMessage;
10066 const ID: u32 = 250u32;
10067 const NAME: &'static str = "DEBUG_VECT";
10068 const EXTRA_CRC: u8 = 49u8;
10069 const ENCODED_LEN: usize = 30usize;
10070 fn deser(
10071 _version: MavlinkVersion,
10072 __input: &[u8],
10073 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10074 let avail_len = __input.len();
10075 let mut payload_buf = [0; Self::ENCODED_LEN];
10076 let mut buf = if avail_len < Self::ENCODED_LEN {
10077 payload_buf[0..avail_len].copy_from_slice(__input);
10078 Bytes::new(&payload_buf)
10079 } else {
10080 Bytes::new(__input)
10081 };
10082 let mut __struct = Self::default();
10083 __struct.time_usec = buf.get_u64_le();
10084 __struct.x = buf.get_f32_le();
10085 __struct.y = buf.get_f32_le();
10086 __struct.z = buf.get_f32_le();
10087 for v in &mut __struct.name {
10088 let val = buf.get_u8();
10089 *v = val;
10090 }
10091 Ok(__struct)
10092 }
10093 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10094 let mut __tmp = BytesMut::new(bytes);
10095 #[allow(clippy::absurd_extreme_comparisons)]
10096 #[allow(unused_comparisons)]
10097 if __tmp.remaining() < Self::ENCODED_LEN {
10098 panic!(
10099 "buffer is too small (need {} bytes, but got {})",
10100 Self::ENCODED_LEN,
10101 __tmp.remaining(),
10102 )
10103 }
10104 __tmp.put_u64_le(self.time_usec);
10105 __tmp.put_f32_le(self.x);
10106 __tmp.put_f32_le(self.y);
10107 __tmp.put_f32_le(self.z);
10108 for val in &self.name {
10109 __tmp.put_u8(*val);
10110 }
10111 if matches!(version, MavlinkVersion::V2) {
10112 let len = __tmp.len();
10113 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10114 } else {
10115 __tmp.len()
10116 }
10117 }
10118}
10119#[doc = "id: 132"]
10120#[doc = "Distance sensor information for an onboard rangefinder."]
10121#[derive(Debug, Clone, PartialEq)]
10122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10124pub struct DISTANCE_SENSOR_DATA {
10125 #[doc = "Timestamp (time since system boot)."]
10126 pub time_boot_ms: u32,
10127 #[doc = "Minimum distance the sensor can measure"]
10128 pub min_distance: u16,
10129 #[doc = "Maximum distance the sensor can measure"]
10130 pub max_distance: u16,
10131 #[doc = "Current distance reading"]
10132 pub current_distance: u16,
10133 #[doc = "Type of distance sensor."]
10134 pub mavtype: MavDistanceSensor,
10135 #[doc = "Onboard ID of the sensor"]
10136 pub id: u8,
10137 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10138 pub orientation: MavSensorOrientation,
10139 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10140 pub covariance: u8,
10141 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10142 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10143 pub horizontal_fov: f32,
10144 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10145 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10146 pub vertical_fov: f32,
10147 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10148 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10149 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10150 pub quaternion: [f32; 4],
10151 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10152 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10153 pub signal_quality: u8,
10154}
10155impl DISTANCE_SENSOR_DATA {
10156 pub const ENCODED_LEN: usize = 39usize;
10157 pub const DEFAULT: Self = Self {
10158 time_boot_ms: 0_u32,
10159 min_distance: 0_u16,
10160 max_distance: 0_u16,
10161 current_distance: 0_u16,
10162 mavtype: MavDistanceSensor::DEFAULT,
10163 id: 0_u8,
10164 orientation: MavSensorOrientation::DEFAULT,
10165 covariance: 0_u8,
10166 horizontal_fov: 0.0_f32,
10167 vertical_fov: 0.0_f32,
10168 quaternion: [0.0_f32; 4usize],
10169 signal_quality: 0_u8,
10170 };
10171 #[cfg(feature = "arbitrary")]
10172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10173 use arbitrary::{Arbitrary, Unstructured};
10174 let mut buf = [0u8; 1024];
10175 rng.fill_bytes(&mut buf);
10176 let mut unstructured = Unstructured::new(&buf);
10177 Self::arbitrary(&mut unstructured).unwrap_or_default()
10178 }
10179}
10180impl Default for DISTANCE_SENSOR_DATA {
10181 fn default() -> Self {
10182 Self::DEFAULT.clone()
10183 }
10184}
10185impl MessageData for DISTANCE_SENSOR_DATA {
10186 type Message = MavMessage;
10187 const ID: u32 = 132u32;
10188 const NAME: &'static str = "DISTANCE_SENSOR";
10189 const EXTRA_CRC: u8 = 85u8;
10190 const ENCODED_LEN: usize = 39usize;
10191 fn deser(
10192 _version: MavlinkVersion,
10193 __input: &[u8],
10194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10195 let avail_len = __input.len();
10196 let mut payload_buf = [0; Self::ENCODED_LEN];
10197 let mut buf = if avail_len < Self::ENCODED_LEN {
10198 payload_buf[0..avail_len].copy_from_slice(__input);
10199 Bytes::new(&payload_buf)
10200 } else {
10201 Bytes::new(__input)
10202 };
10203 let mut __struct = Self::default();
10204 __struct.time_boot_ms = buf.get_u32_le();
10205 __struct.min_distance = buf.get_u16_le();
10206 __struct.max_distance = buf.get_u16_le();
10207 __struct.current_distance = buf.get_u16_le();
10208 let tmp = buf.get_u8();
10209 __struct.mavtype =
10210 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10211 enum_type: "MavDistanceSensor",
10212 value: tmp as u32,
10213 })?;
10214 __struct.id = buf.get_u8();
10215 let tmp = buf.get_u8();
10216 __struct.orientation =
10217 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10218 enum_type: "MavSensorOrientation",
10219 value: tmp as u32,
10220 })?;
10221 __struct.covariance = buf.get_u8();
10222 __struct.horizontal_fov = buf.get_f32_le();
10223 __struct.vertical_fov = buf.get_f32_le();
10224 for v in &mut __struct.quaternion {
10225 let val = buf.get_f32_le();
10226 *v = val;
10227 }
10228 __struct.signal_quality = buf.get_u8();
10229 Ok(__struct)
10230 }
10231 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10232 let mut __tmp = BytesMut::new(bytes);
10233 #[allow(clippy::absurd_extreme_comparisons)]
10234 #[allow(unused_comparisons)]
10235 if __tmp.remaining() < Self::ENCODED_LEN {
10236 panic!(
10237 "buffer is too small (need {} bytes, but got {})",
10238 Self::ENCODED_LEN,
10239 __tmp.remaining(),
10240 )
10241 }
10242 __tmp.put_u32_le(self.time_boot_ms);
10243 __tmp.put_u16_le(self.min_distance);
10244 __tmp.put_u16_le(self.max_distance);
10245 __tmp.put_u16_le(self.current_distance);
10246 __tmp.put_u8(self.mavtype as u8);
10247 __tmp.put_u8(self.id);
10248 __tmp.put_u8(self.orientation as u8);
10249 __tmp.put_u8(self.covariance);
10250 __tmp.put_f32_le(self.horizontal_fov);
10251 __tmp.put_f32_le(self.vertical_fov);
10252 for val in &self.quaternion {
10253 __tmp.put_f32_le(*val);
10254 }
10255 __tmp.put_u8(self.signal_quality);
10256 if matches!(version, MavlinkVersion::V2) {
10257 let len = __tmp.len();
10258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10259 } else {
10260 __tmp.len()
10261 }
10262 }
10263}
10264#[doc = "id: 225"]
10265#[doc = "EFI status output."]
10266#[derive(Debug, Clone, PartialEq)]
10267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10269pub struct EFI_STATUS_DATA {
10270 #[doc = "ECU index"]
10271 pub ecu_index: f32,
10272 #[doc = "RPM"]
10273 pub rpm: f32,
10274 #[doc = "Fuel consumed"]
10275 pub fuel_consumed: f32,
10276 #[doc = "Fuel flow rate"]
10277 pub fuel_flow: f32,
10278 #[doc = "Engine load"]
10279 pub engine_load: f32,
10280 #[doc = "Throttle position"]
10281 pub throttle_position: f32,
10282 #[doc = "Spark dwell time"]
10283 pub spark_dwell_time: f32,
10284 #[doc = "Barometric pressure"]
10285 pub barometric_pressure: f32,
10286 #[doc = "Intake manifold pressure("]
10287 pub intake_manifold_pressure: f32,
10288 #[doc = "Intake manifold temperature"]
10289 pub intake_manifold_temperature: f32,
10290 #[doc = "Cylinder head temperature"]
10291 pub cylinder_head_temperature: f32,
10292 #[doc = "Ignition timing (Crank angle degrees)"]
10293 pub ignition_timing: f32,
10294 #[doc = "Injection time"]
10295 pub injection_time: f32,
10296 #[doc = "Exhaust gas temperature"]
10297 pub exhaust_gas_temperature: f32,
10298 #[doc = "Output throttle"]
10299 pub throttle_out: f32,
10300 #[doc = "Pressure/temperature compensation"]
10301 pub pt_compensation: f32,
10302 #[doc = "EFI health status"]
10303 pub health: u8,
10304 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10305 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10306 pub ignition_voltage: f32,
10307 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10308 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10309 pub fuel_pressure: f32,
10310}
10311impl EFI_STATUS_DATA {
10312 pub const ENCODED_LEN: usize = 73usize;
10313 pub const DEFAULT: Self = Self {
10314 ecu_index: 0.0_f32,
10315 rpm: 0.0_f32,
10316 fuel_consumed: 0.0_f32,
10317 fuel_flow: 0.0_f32,
10318 engine_load: 0.0_f32,
10319 throttle_position: 0.0_f32,
10320 spark_dwell_time: 0.0_f32,
10321 barometric_pressure: 0.0_f32,
10322 intake_manifold_pressure: 0.0_f32,
10323 intake_manifold_temperature: 0.0_f32,
10324 cylinder_head_temperature: 0.0_f32,
10325 ignition_timing: 0.0_f32,
10326 injection_time: 0.0_f32,
10327 exhaust_gas_temperature: 0.0_f32,
10328 throttle_out: 0.0_f32,
10329 pt_compensation: 0.0_f32,
10330 health: 0_u8,
10331 ignition_voltage: 0.0_f32,
10332 fuel_pressure: 0.0_f32,
10333 };
10334 #[cfg(feature = "arbitrary")]
10335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10336 use arbitrary::{Arbitrary, Unstructured};
10337 let mut buf = [0u8; 1024];
10338 rng.fill_bytes(&mut buf);
10339 let mut unstructured = Unstructured::new(&buf);
10340 Self::arbitrary(&mut unstructured).unwrap_or_default()
10341 }
10342}
10343impl Default for EFI_STATUS_DATA {
10344 fn default() -> Self {
10345 Self::DEFAULT.clone()
10346 }
10347}
10348impl MessageData for EFI_STATUS_DATA {
10349 type Message = MavMessage;
10350 const ID: u32 = 225u32;
10351 const NAME: &'static str = "EFI_STATUS";
10352 const EXTRA_CRC: u8 = 208u8;
10353 const ENCODED_LEN: usize = 73usize;
10354 fn deser(
10355 _version: MavlinkVersion,
10356 __input: &[u8],
10357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10358 let avail_len = __input.len();
10359 let mut payload_buf = [0; Self::ENCODED_LEN];
10360 let mut buf = if avail_len < Self::ENCODED_LEN {
10361 payload_buf[0..avail_len].copy_from_slice(__input);
10362 Bytes::new(&payload_buf)
10363 } else {
10364 Bytes::new(__input)
10365 };
10366 let mut __struct = Self::default();
10367 __struct.ecu_index = buf.get_f32_le();
10368 __struct.rpm = buf.get_f32_le();
10369 __struct.fuel_consumed = buf.get_f32_le();
10370 __struct.fuel_flow = buf.get_f32_le();
10371 __struct.engine_load = buf.get_f32_le();
10372 __struct.throttle_position = buf.get_f32_le();
10373 __struct.spark_dwell_time = buf.get_f32_le();
10374 __struct.barometric_pressure = buf.get_f32_le();
10375 __struct.intake_manifold_pressure = buf.get_f32_le();
10376 __struct.intake_manifold_temperature = buf.get_f32_le();
10377 __struct.cylinder_head_temperature = buf.get_f32_le();
10378 __struct.ignition_timing = buf.get_f32_le();
10379 __struct.injection_time = buf.get_f32_le();
10380 __struct.exhaust_gas_temperature = buf.get_f32_le();
10381 __struct.throttle_out = buf.get_f32_le();
10382 __struct.pt_compensation = buf.get_f32_le();
10383 __struct.health = buf.get_u8();
10384 __struct.ignition_voltage = buf.get_f32_le();
10385 __struct.fuel_pressure = buf.get_f32_le();
10386 Ok(__struct)
10387 }
10388 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10389 let mut __tmp = BytesMut::new(bytes);
10390 #[allow(clippy::absurd_extreme_comparisons)]
10391 #[allow(unused_comparisons)]
10392 if __tmp.remaining() < Self::ENCODED_LEN {
10393 panic!(
10394 "buffer is too small (need {} bytes, but got {})",
10395 Self::ENCODED_LEN,
10396 __tmp.remaining(),
10397 )
10398 }
10399 __tmp.put_f32_le(self.ecu_index);
10400 __tmp.put_f32_le(self.rpm);
10401 __tmp.put_f32_le(self.fuel_consumed);
10402 __tmp.put_f32_le(self.fuel_flow);
10403 __tmp.put_f32_le(self.engine_load);
10404 __tmp.put_f32_le(self.throttle_position);
10405 __tmp.put_f32_le(self.spark_dwell_time);
10406 __tmp.put_f32_le(self.barometric_pressure);
10407 __tmp.put_f32_le(self.intake_manifold_pressure);
10408 __tmp.put_f32_le(self.intake_manifold_temperature);
10409 __tmp.put_f32_le(self.cylinder_head_temperature);
10410 __tmp.put_f32_le(self.ignition_timing);
10411 __tmp.put_f32_le(self.injection_time);
10412 __tmp.put_f32_le(self.exhaust_gas_temperature);
10413 __tmp.put_f32_le(self.throttle_out);
10414 __tmp.put_f32_le(self.pt_compensation);
10415 __tmp.put_u8(self.health);
10416 __tmp.put_f32_le(self.ignition_voltage);
10417 __tmp.put_f32_le(self.fuel_pressure);
10418 if matches!(version, MavlinkVersion::V2) {
10419 let len = __tmp.len();
10420 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10421 } else {
10422 __tmp.len()
10423 }
10424 }
10425}
10426#[doc = "id: 131"]
10427#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10428#[derive(Debug, Clone, PartialEq)]
10429#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10430#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10431pub struct ENCAPSULATED_DATA_DATA {
10432 #[doc = "sequence number (starting with 0 on every transmission)"]
10433 pub seqnr: u16,
10434 #[doc = "image data bytes"]
10435 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10436 pub data: [u8; 253],
10437}
10438impl ENCAPSULATED_DATA_DATA {
10439 pub const ENCODED_LEN: usize = 255usize;
10440 pub const DEFAULT: Self = Self {
10441 seqnr: 0_u16,
10442 data: [0_u8; 253usize],
10443 };
10444 #[cfg(feature = "arbitrary")]
10445 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10446 use arbitrary::{Arbitrary, Unstructured};
10447 let mut buf = [0u8; 1024];
10448 rng.fill_bytes(&mut buf);
10449 let mut unstructured = Unstructured::new(&buf);
10450 Self::arbitrary(&mut unstructured).unwrap_or_default()
10451 }
10452}
10453impl Default for ENCAPSULATED_DATA_DATA {
10454 fn default() -> Self {
10455 Self::DEFAULT.clone()
10456 }
10457}
10458impl MessageData for ENCAPSULATED_DATA_DATA {
10459 type Message = MavMessage;
10460 const ID: u32 = 131u32;
10461 const NAME: &'static str = "ENCAPSULATED_DATA";
10462 const EXTRA_CRC: u8 = 223u8;
10463 const ENCODED_LEN: usize = 255usize;
10464 fn deser(
10465 _version: MavlinkVersion,
10466 __input: &[u8],
10467 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10468 let avail_len = __input.len();
10469 let mut payload_buf = [0; Self::ENCODED_LEN];
10470 let mut buf = if avail_len < Self::ENCODED_LEN {
10471 payload_buf[0..avail_len].copy_from_slice(__input);
10472 Bytes::new(&payload_buf)
10473 } else {
10474 Bytes::new(__input)
10475 };
10476 let mut __struct = Self::default();
10477 __struct.seqnr = buf.get_u16_le();
10478 for v in &mut __struct.data {
10479 let val = buf.get_u8();
10480 *v = val;
10481 }
10482 Ok(__struct)
10483 }
10484 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10485 let mut __tmp = BytesMut::new(bytes);
10486 #[allow(clippy::absurd_extreme_comparisons)]
10487 #[allow(unused_comparisons)]
10488 if __tmp.remaining() < Self::ENCODED_LEN {
10489 panic!(
10490 "buffer is too small (need {} bytes, but got {})",
10491 Self::ENCODED_LEN,
10492 __tmp.remaining(),
10493 )
10494 }
10495 __tmp.put_u16_le(self.seqnr);
10496 for val in &self.data {
10497 __tmp.put_u8(*val);
10498 }
10499 if matches!(version, MavlinkVersion::V2) {
10500 let len = __tmp.len();
10501 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10502 } else {
10503 __tmp.len()
10504 }
10505 }
10506}
10507#[doc = "id: 290"]
10508#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
10509#[derive(Debug, Clone, PartialEq)]
10510#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10511#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10512pub struct ESC_INFO_DATA {
10513 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10514 pub time_usec: u64,
10515 #[doc = "Number of reported errors by each ESC since boot."]
10516 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10517 pub error_count: [u32; 4],
10518 #[doc = "Counter of data packets received."]
10519 pub counter: u16,
10520 #[doc = "Bitmap of ESC failure flags."]
10521 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10522 pub failure_flags: [u16; 4],
10523 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
10524 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10525 pub temperature: [i16; 4],
10526 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10527 pub index: u8,
10528 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
10529 pub count: u8,
10530 #[doc = "Connection type protocol for all ESC."]
10531 pub connection_type: EscConnectionType,
10532 #[doc = "Information regarding online/offline status of each ESC."]
10533 pub info: u8,
10534}
10535impl ESC_INFO_DATA {
10536 pub const ENCODED_LEN: usize = 46usize;
10537 pub const DEFAULT: Self = Self {
10538 time_usec: 0_u64,
10539 error_count: [0_u32; 4usize],
10540 counter: 0_u16,
10541 failure_flags: [0_u16; 4usize],
10542 temperature: [0_i16; 4usize],
10543 index: 0_u8,
10544 count: 0_u8,
10545 connection_type: EscConnectionType::DEFAULT,
10546 info: 0_u8,
10547 };
10548 #[cfg(feature = "arbitrary")]
10549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10550 use arbitrary::{Arbitrary, Unstructured};
10551 let mut buf = [0u8; 1024];
10552 rng.fill_bytes(&mut buf);
10553 let mut unstructured = Unstructured::new(&buf);
10554 Self::arbitrary(&mut unstructured).unwrap_or_default()
10555 }
10556}
10557impl Default for ESC_INFO_DATA {
10558 fn default() -> Self {
10559 Self::DEFAULT.clone()
10560 }
10561}
10562impl MessageData for ESC_INFO_DATA {
10563 type Message = MavMessage;
10564 const ID: u32 = 290u32;
10565 const NAME: &'static str = "ESC_INFO";
10566 const EXTRA_CRC: u8 = 251u8;
10567 const ENCODED_LEN: usize = 46usize;
10568 fn deser(
10569 _version: MavlinkVersion,
10570 __input: &[u8],
10571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10572 let avail_len = __input.len();
10573 let mut payload_buf = [0; Self::ENCODED_LEN];
10574 let mut buf = if avail_len < Self::ENCODED_LEN {
10575 payload_buf[0..avail_len].copy_from_slice(__input);
10576 Bytes::new(&payload_buf)
10577 } else {
10578 Bytes::new(__input)
10579 };
10580 let mut __struct = Self::default();
10581 __struct.time_usec = buf.get_u64_le();
10582 for v in &mut __struct.error_count {
10583 let val = buf.get_u32_le();
10584 *v = val;
10585 }
10586 __struct.counter = buf.get_u16_le();
10587 for v in &mut __struct.failure_flags {
10588 let val = buf.get_u16_le();
10589 *v = val;
10590 }
10591 for v in &mut __struct.temperature {
10592 let val = buf.get_i16_le();
10593 *v = val;
10594 }
10595 __struct.index = buf.get_u8();
10596 __struct.count = buf.get_u8();
10597 let tmp = buf.get_u8();
10598 __struct.connection_type =
10599 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10600 enum_type: "EscConnectionType",
10601 value: tmp as u32,
10602 })?;
10603 __struct.info = buf.get_u8();
10604 Ok(__struct)
10605 }
10606 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10607 let mut __tmp = BytesMut::new(bytes);
10608 #[allow(clippy::absurd_extreme_comparisons)]
10609 #[allow(unused_comparisons)]
10610 if __tmp.remaining() < Self::ENCODED_LEN {
10611 panic!(
10612 "buffer is too small (need {} bytes, but got {})",
10613 Self::ENCODED_LEN,
10614 __tmp.remaining(),
10615 )
10616 }
10617 __tmp.put_u64_le(self.time_usec);
10618 for val in &self.error_count {
10619 __tmp.put_u32_le(*val);
10620 }
10621 __tmp.put_u16_le(self.counter);
10622 for val in &self.failure_flags {
10623 __tmp.put_u16_le(*val);
10624 }
10625 for val in &self.temperature {
10626 __tmp.put_i16_le(*val);
10627 }
10628 __tmp.put_u8(self.index);
10629 __tmp.put_u8(self.count);
10630 __tmp.put_u8(self.connection_type as u8);
10631 __tmp.put_u8(self.info);
10632 if matches!(version, MavlinkVersion::V2) {
10633 let len = __tmp.len();
10634 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10635 } else {
10636 __tmp.len()
10637 }
10638 }
10639}
10640#[doc = "id: 291"]
10641#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
10642#[derive(Debug, Clone, PartialEq)]
10643#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10644#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10645pub struct ESC_STATUS_DATA {
10646 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10647 pub time_usec: u64,
10648 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
10649 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10650 pub rpm: [i32; 4],
10651 #[doc = "Voltage measured from each ESC."]
10652 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10653 pub voltage: [f32; 4],
10654 #[doc = "Current measured from each ESC."]
10655 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10656 pub current: [f32; 4],
10657 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10658 pub index: u8,
10659}
10660impl ESC_STATUS_DATA {
10661 pub const ENCODED_LEN: usize = 57usize;
10662 pub const DEFAULT: Self = Self {
10663 time_usec: 0_u64,
10664 rpm: [0_i32; 4usize],
10665 voltage: [0.0_f32; 4usize],
10666 current: [0.0_f32; 4usize],
10667 index: 0_u8,
10668 };
10669 #[cfg(feature = "arbitrary")]
10670 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10671 use arbitrary::{Arbitrary, Unstructured};
10672 let mut buf = [0u8; 1024];
10673 rng.fill_bytes(&mut buf);
10674 let mut unstructured = Unstructured::new(&buf);
10675 Self::arbitrary(&mut unstructured).unwrap_or_default()
10676 }
10677}
10678impl Default for ESC_STATUS_DATA {
10679 fn default() -> Self {
10680 Self::DEFAULT.clone()
10681 }
10682}
10683impl MessageData for ESC_STATUS_DATA {
10684 type Message = MavMessage;
10685 const ID: u32 = 291u32;
10686 const NAME: &'static str = "ESC_STATUS";
10687 const EXTRA_CRC: u8 = 10u8;
10688 const ENCODED_LEN: usize = 57usize;
10689 fn deser(
10690 _version: MavlinkVersion,
10691 __input: &[u8],
10692 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10693 let avail_len = __input.len();
10694 let mut payload_buf = [0; Self::ENCODED_LEN];
10695 let mut buf = if avail_len < Self::ENCODED_LEN {
10696 payload_buf[0..avail_len].copy_from_slice(__input);
10697 Bytes::new(&payload_buf)
10698 } else {
10699 Bytes::new(__input)
10700 };
10701 let mut __struct = Self::default();
10702 __struct.time_usec = buf.get_u64_le();
10703 for v in &mut __struct.rpm {
10704 let val = buf.get_i32_le();
10705 *v = val;
10706 }
10707 for v in &mut __struct.voltage {
10708 let val = buf.get_f32_le();
10709 *v = val;
10710 }
10711 for v in &mut __struct.current {
10712 let val = buf.get_f32_le();
10713 *v = val;
10714 }
10715 __struct.index = buf.get_u8();
10716 Ok(__struct)
10717 }
10718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10719 let mut __tmp = BytesMut::new(bytes);
10720 #[allow(clippy::absurd_extreme_comparisons)]
10721 #[allow(unused_comparisons)]
10722 if __tmp.remaining() < Self::ENCODED_LEN {
10723 panic!(
10724 "buffer is too small (need {} bytes, but got {})",
10725 Self::ENCODED_LEN,
10726 __tmp.remaining(),
10727 )
10728 }
10729 __tmp.put_u64_le(self.time_usec);
10730 for val in &self.rpm {
10731 __tmp.put_i32_le(*val);
10732 }
10733 for val in &self.voltage {
10734 __tmp.put_f32_le(*val);
10735 }
10736 for val in &self.current {
10737 __tmp.put_f32_le(*val);
10738 }
10739 __tmp.put_u8(self.index);
10740 if matches!(version, MavlinkVersion::V2) {
10741 let len = __tmp.len();
10742 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10743 } else {
10744 __tmp.len()
10745 }
10746 }
10747}
10748#[doc = "id: 230"]
10749#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
10750#[derive(Debug, Clone, PartialEq)]
10751#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10752#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10753pub struct ESTIMATOR_STATUS_DATA {
10754 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10755 pub time_usec: u64,
10756 #[doc = "Velocity innovation test ratio"]
10757 pub vel_ratio: f32,
10758 #[doc = "Horizontal position innovation test ratio"]
10759 pub pos_horiz_ratio: f32,
10760 #[doc = "Vertical position innovation test ratio"]
10761 pub pos_vert_ratio: f32,
10762 #[doc = "Magnetometer innovation test ratio"]
10763 pub mag_ratio: f32,
10764 #[doc = "Height above terrain innovation test ratio"]
10765 pub hagl_ratio: f32,
10766 #[doc = "True airspeed innovation test ratio"]
10767 pub tas_ratio: f32,
10768 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
10769 pub pos_horiz_accuracy: f32,
10770 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
10771 pub pos_vert_accuracy: f32,
10772 #[doc = "Bitmap indicating which EKF outputs are valid."]
10773 pub flags: EstimatorStatusFlags,
10774}
10775impl ESTIMATOR_STATUS_DATA {
10776 pub const ENCODED_LEN: usize = 42usize;
10777 pub const DEFAULT: Self = Self {
10778 time_usec: 0_u64,
10779 vel_ratio: 0.0_f32,
10780 pos_horiz_ratio: 0.0_f32,
10781 pos_vert_ratio: 0.0_f32,
10782 mag_ratio: 0.0_f32,
10783 hagl_ratio: 0.0_f32,
10784 tas_ratio: 0.0_f32,
10785 pos_horiz_accuracy: 0.0_f32,
10786 pos_vert_accuracy: 0.0_f32,
10787 flags: EstimatorStatusFlags::DEFAULT,
10788 };
10789 #[cfg(feature = "arbitrary")]
10790 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10791 use arbitrary::{Arbitrary, Unstructured};
10792 let mut buf = [0u8; 1024];
10793 rng.fill_bytes(&mut buf);
10794 let mut unstructured = Unstructured::new(&buf);
10795 Self::arbitrary(&mut unstructured).unwrap_or_default()
10796 }
10797}
10798impl Default for ESTIMATOR_STATUS_DATA {
10799 fn default() -> Self {
10800 Self::DEFAULT.clone()
10801 }
10802}
10803impl MessageData for ESTIMATOR_STATUS_DATA {
10804 type Message = MavMessage;
10805 const ID: u32 = 230u32;
10806 const NAME: &'static str = "ESTIMATOR_STATUS";
10807 const EXTRA_CRC: u8 = 163u8;
10808 const ENCODED_LEN: usize = 42usize;
10809 fn deser(
10810 _version: MavlinkVersion,
10811 __input: &[u8],
10812 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10813 let avail_len = __input.len();
10814 let mut payload_buf = [0; Self::ENCODED_LEN];
10815 let mut buf = if avail_len < Self::ENCODED_LEN {
10816 payload_buf[0..avail_len].copy_from_slice(__input);
10817 Bytes::new(&payload_buf)
10818 } else {
10819 Bytes::new(__input)
10820 };
10821 let mut __struct = Self::default();
10822 __struct.time_usec = buf.get_u64_le();
10823 __struct.vel_ratio = buf.get_f32_le();
10824 __struct.pos_horiz_ratio = buf.get_f32_le();
10825 __struct.pos_vert_ratio = buf.get_f32_le();
10826 __struct.mag_ratio = buf.get_f32_le();
10827 __struct.hagl_ratio = buf.get_f32_le();
10828 __struct.tas_ratio = buf.get_f32_le();
10829 __struct.pos_horiz_accuracy = buf.get_f32_le();
10830 __struct.pos_vert_accuracy = buf.get_f32_le();
10831 let tmp = buf.get_u16_le();
10832 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
10833 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10834 flag_type: "EstimatorStatusFlags",
10835 value: tmp as u32,
10836 })?;
10837 Ok(__struct)
10838 }
10839 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10840 let mut __tmp = BytesMut::new(bytes);
10841 #[allow(clippy::absurd_extreme_comparisons)]
10842 #[allow(unused_comparisons)]
10843 if __tmp.remaining() < Self::ENCODED_LEN {
10844 panic!(
10845 "buffer is too small (need {} bytes, but got {})",
10846 Self::ENCODED_LEN,
10847 __tmp.remaining(),
10848 )
10849 }
10850 __tmp.put_u64_le(self.time_usec);
10851 __tmp.put_f32_le(self.vel_ratio);
10852 __tmp.put_f32_le(self.pos_horiz_ratio);
10853 __tmp.put_f32_le(self.pos_vert_ratio);
10854 __tmp.put_f32_le(self.mag_ratio);
10855 __tmp.put_f32_le(self.hagl_ratio);
10856 __tmp.put_f32_le(self.tas_ratio);
10857 __tmp.put_f32_le(self.pos_horiz_accuracy);
10858 __tmp.put_f32_le(self.pos_vert_accuracy);
10859 __tmp.put_u16_le(self.flags.bits());
10860 if matches!(version, MavlinkVersion::V2) {
10861 let len = __tmp.len();
10862 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10863 } else {
10864 __tmp.len()
10865 }
10866 }
10867}
10868#[doc = "id: 410"]
10869#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
10870#[derive(Debug, Clone, PartialEq)]
10871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10872#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10873pub struct EVENT_DATA {
10874 #[doc = "Event ID (as defined in the component metadata)"]
10875 pub id: u32,
10876 #[doc = "Timestamp (time since system boot when the event happened)."]
10877 pub event_time_boot_ms: u32,
10878 #[doc = "Sequence number."]
10879 pub sequence: u16,
10880 #[doc = "Component ID"]
10881 pub destination_component: u8,
10882 #[doc = "System ID"]
10883 pub destination_system: u8,
10884 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
10885 pub log_levels: u8,
10886 #[doc = "Arguments (depend on event ID)."]
10887 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10888 pub arguments: [u8; 40],
10889}
10890impl EVENT_DATA {
10891 pub const ENCODED_LEN: usize = 53usize;
10892 pub const DEFAULT: Self = Self {
10893 id: 0_u32,
10894 event_time_boot_ms: 0_u32,
10895 sequence: 0_u16,
10896 destination_component: 0_u8,
10897 destination_system: 0_u8,
10898 log_levels: 0_u8,
10899 arguments: [0_u8; 40usize],
10900 };
10901 #[cfg(feature = "arbitrary")]
10902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10903 use arbitrary::{Arbitrary, Unstructured};
10904 let mut buf = [0u8; 1024];
10905 rng.fill_bytes(&mut buf);
10906 let mut unstructured = Unstructured::new(&buf);
10907 Self::arbitrary(&mut unstructured).unwrap_or_default()
10908 }
10909}
10910impl Default for EVENT_DATA {
10911 fn default() -> Self {
10912 Self::DEFAULT.clone()
10913 }
10914}
10915impl MessageData for EVENT_DATA {
10916 type Message = MavMessage;
10917 const ID: u32 = 410u32;
10918 const NAME: &'static str = "EVENT";
10919 const EXTRA_CRC: u8 = 160u8;
10920 const ENCODED_LEN: usize = 53usize;
10921 fn deser(
10922 _version: MavlinkVersion,
10923 __input: &[u8],
10924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10925 let avail_len = __input.len();
10926 let mut payload_buf = [0; Self::ENCODED_LEN];
10927 let mut buf = if avail_len < Self::ENCODED_LEN {
10928 payload_buf[0..avail_len].copy_from_slice(__input);
10929 Bytes::new(&payload_buf)
10930 } else {
10931 Bytes::new(__input)
10932 };
10933 let mut __struct = Self::default();
10934 __struct.id = buf.get_u32_le();
10935 __struct.event_time_boot_ms = buf.get_u32_le();
10936 __struct.sequence = buf.get_u16_le();
10937 __struct.destination_component = buf.get_u8();
10938 __struct.destination_system = buf.get_u8();
10939 __struct.log_levels = buf.get_u8();
10940 for v in &mut __struct.arguments {
10941 let val = buf.get_u8();
10942 *v = val;
10943 }
10944 Ok(__struct)
10945 }
10946 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10947 let mut __tmp = BytesMut::new(bytes);
10948 #[allow(clippy::absurd_extreme_comparisons)]
10949 #[allow(unused_comparisons)]
10950 if __tmp.remaining() < Self::ENCODED_LEN {
10951 panic!(
10952 "buffer is too small (need {} bytes, but got {})",
10953 Self::ENCODED_LEN,
10954 __tmp.remaining(),
10955 )
10956 }
10957 __tmp.put_u32_le(self.id);
10958 __tmp.put_u32_le(self.event_time_boot_ms);
10959 __tmp.put_u16_le(self.sequence);
10960 __tmp.put_u8(self.destination_component);
10961 __tmp.put_u8(self.destination_system);
10962 __tmp.put_u8(self.log_levels);
10963 for val in &self.arguments {
10964 __tmp.put_u8(*val);
10965 }
10966 if matches!(version, MavlinkVersion::V2) {
10967 let len = __tmp.len();
10968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10969 } else {
10970 __tmp.len()
10971 }
10972 }
10973}
10974#[doc = "id: 245"]
10975#[doc = "Provides state for additional features."]
10976#[derive(Debug, Clone, PartialEq)]
10977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10979pub struct EXTENDED_SYS_STATE_DATA {
10980 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
10981 pub vtol_state: MavVtolState,
10982 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
10983 pub landed_state: MavLandedState,
10984}
10985impl EXTENDED_SYS_STATE_DATA {
10986 pub const ENCODED_LEN: usize = 2usize;
10987 pub const DEFAULT: Self = Self {
10988 vtol_state: MavVtolState::DEFAULT,
10989 landed_state: MavLandedState::DEFAULT,
10990 };
10991 #[cfg(feature = "arbitrary")]
10992 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10993 use arbitrary::{Arbitrary, Unstructured};
10994 let mut buf = [0u8; 1024];
10995 rng.fill_bytes(&mut buf);
10996 let mut unstructured = Unstructured::new(&buf);
10997 Self::arbitrary(&mut unstructured).unwrap_or_default()
10998 }
10999}
11000impl Default for EXTENDED_SYS_STATE_DATA {
11001 fn default() -> Self {
11002 Self::DEFAULT.clone()
11003 }
11004}
11005impl MessageData for EXTENDED_SYS_STATE_DATA {
11006 type Message = MavMessage;
11007 const ID: u32 = 245u32;
11008 const NAME: &'static str = "EXTENDED_SYS_STATE";
11009 const EXTRA_CRC: u8 = 130u8;
11010 const ENCODED_LEN: usize = 2usize;
11011 fn deser(
11012 _version: MavlinkVersion,
11013 __input: &[u8],
11014 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11015 let avail_len = __input.len();
11016 let mut payload_buf = [0; Self::ENCODED_LEN];
11017 let mut buf = if avail_len < Self::ENCODED_LEN {
11018 payload_buf[0..avail_len].copy_from_slice(__input);
11019 Bytes::new(&payload_buf)
11020 } else {
11021 Bytes::new(__input)
11022 };
11023 let mut __struct = Self::default();
11024 let tmp = buf.get_u8();
11025 __struct.vtol_state =
11026 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11027 enum_type: "MavVtolState",
11028 value: tmp as u32,
11029 })?;
11030 let tmp = buf.get_u8();
11031 __struct.landed_state =
11032 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11033 enum_type: "MavLandedState",
11034 value: tmp as u32,
11035 })?;
11036 Ok(__struct)
11037 }
11038 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11039 let mut __tmp = BytesMut::new(bytes);
11040 #[allow(clippy::absurd_extreme_comparisons)]
11041 #[allow(unused_comparisons)]
11042 if __tmp.remaining() < Self::ENCODED_LEN {
11043 panic!(
11044 "buffer is too small (need {} bytes, but got {})",
11045 Self::ENCODED_LEN,
11046 __tmp.remaining(),
11047 )
11048 }
11049 __tmp.put_u8(self.vtol_state as u8);
11050 __tmp.put_u8(self.landed_state as u8);
11051 if matches!(version, MavlinkVersion::V2) {
11052 let len = __tmp.len();
11053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11054 } else {
11055 __tmp.len()
11056 }
11057 }
11058}
11059#[doc = "id: 162"]
11060#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11061#[derive(Debug, Clone, PartialEq)]
11062#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11064pub struct FENCE_STATUS_DATA {
11065 #[doc = "Time (since boot) of last breach."]
11066 pub breach_time: u32,
11067 #[doc = "Number of fence breaches."]
11068 pub breach_count: u16,
11069 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11070 pub breach_status: u8,
11071 #[doc = "Last breach type."]
11072 pub breach_type: FenceBreach,
11073 #[doc = "Active action to prevent fence breach"]
11074 #[cfg_attr(feature = "serde", serde(default))]
11075 pub breach_mitigation: FenceMitigate,
11076}
11077impl FENCE_STATUS_DATA {
11078 pub const ENCODED_LEN: usize = 9usize;
11079 pub const DEFAULT: Self = Self {
11080 breach_time: 0_u32,
11081 breach_count: 0_u16,
11082 breach_status: 0_u8,
11083 breach_type: FenceBreach::DEFAULT,
11084 breach_mitigation: FenceMitigate::DEFAULT,
11085 };
11086 #[cfg(feature = "arbitrary")]
11087 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11088 use arbitrary::{Arbitrary, Unstructured};
11089 let mut buf = [0u8; 1024];
11090 rng.fill_bytes(&mut buf);
11091 let mut unstructured = Unstructured::new(&buf);
11092 Self::arbitrary(&mut unstructured).unwrap_or_default()
11093 }
11094}
11095impl Default for FENCE_STATUS_DATA {
11096 fn default() -> Self {
11097 Self::DEFAULT.clone()
11098 }
11099}
11100impl MessageData for FENCE_STATUS_DATA {
11101 type Message = MavMessage;
11102 const ID: u32 = 162u32;
11103 const NAME: &'static str = "FENCE_STATUS";
11104 const EXTRA_CRC: u8 = 189u8;
11105 const ENCODED_LEN: usize = 9usize;
11106 fn deser(
11107 _version: MavlinkVersion,
11108 __input: &[u8],
11109 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11110 let avail_len = __input.len();
11111 let mut payload_buf = [0; Self::ENCODED_LEN];
11112 let mut buf = if avail_len < Self::ENCODED_LEN {
11113 payload_buf[0..avail_len].copy_from_slice(__input);
11114 Bytes::new(&payload_buf)
11115 } else {
11116 Bytes::new(__input)
11117 };
11118 let mut __struct = Self::default();
11119 __struct.breach_time = buf.get_u32_le();
11120 __struct.breach_count = buf.get_u16_le();
11121 __struct.breach_status = buf.get_u8();
11122 let tmp = buf.get_u8();
11123 __struct.breach_type =
11124 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11125 enum_type: "FenceBreach",
11126 value: tmp as u32,
11127 })?;
11128 let tmp = buf.get_u8();
11129 __struct.breach_mitigation =
11130 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11131 enum_type: "FenceMitigate",
11132 value: tmp as u32,
11133 })?;
11134 Ok(__struct)
11135 }
11136 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11137 let mut __tmp = BytesMut::new(bytes);
11138 #[allow(clippy::absurd_extreme_comparisons)]
11139 #[allow(unused_comparisons)]
11140 if __tmp.remaining() < Self::ENCODED_LEN {
11141 panic!(
11142 "buffer is too small (need {} bytes, but got {})",
11143 Self::ENCODED_LEN,
11144 __tmp.remaining(),
11145 )
11146 }
11147 __tmp.put_u32_le(self.breach_time);
11148 __tmp.put_u16_le(self.breach_count);
11149 __tmp.put_u8(self.breach_status);
11150 __tmp.put_u8(self.breach_type as u8);
11151 __tmp.put_u8(self.breach_mitigation as u8);
11152 if matches!(version, MavlinkVersion::V2) {
11153 let len = __tmp.len();
11154 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11155 } else {
11156 __tmp.len()
11157 }
11158 }
11159}
11160#[doc = "id: 110"]
11161#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11162#[derive(Debug, Clone, PartialEq)]
11163#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11165pub struct FILE_TRANSFER_PROTOCOL_DATA {
11166 #[doc = "Network ID (0 for broadcast)"]
11167 pub target_network: u8,
11168 #[doc = "System ID (0 for broadcast)"]
11169 pub target_system: u8,
11170 #[doc = "Component ID (0 for broadcast)"]
11171 pub target_component: u8,
11172 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11173 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11174 pub payload: [u8; 251],
11175}
11176impl FILE_TRANSFER_PROTOCOL_DATA {
11177 pub const ENCODED_LEN: usize = 254usize;
11178 pub const DEFAULT: Self = Self {
11179 target_network: 0_u8,
11180 target_system: 0_u8,
11181 target_component: 0_u8,
11182 payload: [0_u8; 251usize],
11183 };
11184 #[cfg(feature = "arbitrary")]
11185 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11186 use arbitrary::{Arbitrary, Unstructured};
11187 let mut buf = [0u8; 1024];
11188 rng.fill_bytes(&mut buf);
11189 let mut unstructured = Unstructured::new(&buf);
11190 Self::arbitrary(&mut unstructured).unwrap_or_default()
11191 }
11192}
11193impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11194 fn default() -> Self {
11195 Self::DEFAULT.clone()
11196 }
11197}
11198impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11199 type Message = MavMessage;
11200 const ID: u32 = 110u32;
11201 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11202 const EXTRA_CRC: u8 = 84u8;
11203 const ENCODED_LEN: usize = 254usize;
11204 fn deser(
11205 _version: MavlinkVersion,
11206 __input: &[u8],
11207 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11208 let avail_len = __input.len();
11209 let mut payload_buf = [0; Self::ENCODED_LEN];
11210 let mut buf = if avail_len < Self::ENCODED_LEN {
11211 payload_buf[0..avail_len].copy_from_slice(__input);
11212 Bytes::new(&payload_buf)
11213 } else {
11214 Bytes::new(__input)
11215 };
11216 let mut __struct = Self::default();
11217 __struct.target_network = buf.get_u8();
11218 __struct.target_system = buf.get_u8();
11219 __struct.target_component = buf.get_u8();
11220 for v in &mut __struct.payload {
11221 let val = buf.get_u8();
11222 *v = val;
11223 }
11224 Ok(__struct)
11225 }
11226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11227 let mut __tmp = BytesMut::new(bytes);
11228 #[allow(clippy::absurd_extreme_comparisons)]
11229 #[allow(unused_comparisons)]
11230 if __tmp.remaining() < Self::ENCODED_LEN {
11231 panic!(
11232 "buffer is too small (need {} bytes, but got {})",
11233 Self::ENCODED_LEN,
11234 __tmp.remaining(),
11235 )
11236 }
11237 __tmp.put_u8(self.target_network);
11238 __tmp.put_u8(self.target_system);
11239 __tmp.put_u8(self.target_component);
11240 for val in &self.payload {
11241 __tmp.put_u8(*val);
11242 }
11243 if matches!(version, MavlinkVersion::V2) {
11244 let len = __tmp.len();
11245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11246 } else {
11247 __tmp.len()
11248 }
11249 }
11250}
11251#[doc = "id: 264"]
11252#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11253#[derive(Debug, Clone, PartialEq)]
11254#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11256pub struct FLIGHT_INFORMATION_DATA {
11257 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11258 pub arming_time_utc: u64,
11259 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11260 pub takeoff_time_utc: u64,
11261 #[doc = "Flight number. Note, field is misnamed UUID."]
11262 pub flight_uuid: u64,
11263 #[doc = "Timestamp (time since system boot)."]
11264 pub time_boot_ms: u32,
11265 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11266 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11267 pub landing_time: u32,
11268}
11269impl FLIGHT_INFORMATION_DATA {
11270 pub const ENCODED_LEN: usize = 32usize;
11271 pub const DEFAULT: Self = Self {
11272 arming_time_utc: 0_u64,
11273 takeoff_time_utc: 0_u64,
11274 flight_uuid: 0_u64,
11275 time_boot_ms: 0_u32,
11276 landing_time: 0_u32,
11277 };
11278 #[cfg(feature = "arbitrary")]
11279 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11280 use arbitrary::{Arbitrary, Unstructured};
11281 let mut buf = [0u8; 1024];
11282 rng.fill_bytes(&mut buf);
11283 let mut unstructured = Unstructured::new(&buf);
11284 Self::arbitrary(&mut unstructured).unwrap_or_default()
11285 }
11286}
11287impl Default for FLIGHT_INFORMATION_DATA {
11288 fn default() -> Self {
11289 Self::DEFAULT.clone()
11290 }
11291}
11292impl MessageData for FLIGHT_INFORMATION_DATA {
11293 type Message = MavMessage;
11294 const ID: u32 = 264u32;
11295 const NAME: &'static str = "FLIGHT_INFORMATION";
11296 const EXTRA_CRC: u8 = 49u8;
11297 const ENCODED_LEN: usize = 32usize;
11298 fn deser(
11299 _version: MavlinkVersion,
11300 __input: &[u8],
11301 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11302 let avail_len = __input.len();
11303 let mut payload_buf = [0; Self::ENCODED_LEN];
11304 let mut buf = if avail_len < Self::ENCODED_LEN {
11305 payload_buf[0..avail_len].copy_from_slice(__input);
11306 Bytes::new(&payload_buf)
11307 } else {
11308 Bytes::new(__input)
11309 };
11310 let mut __struct = Self::default();
11311 __struct.arming_time_utc = buf.get_u64_le();
11312 __struct.takeoff_time_utc = buf.get_u64_le();
11313 __struct.flight_uuid = buf.get_u64_le();
11314 __struct.time_boot_ms = buf.get_u32_le();
11315 __struct.landing_time = buf.get_u32_le();
11316 Ok(__struct)
11317 }
11318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11319 let mut __tmp = BytesMut::new(bytes);
11320 #[allow(clippy::absurd_extreme_comparisons)]
11321 #[allow(unused_comparisons)]
11322 if __tmp.remaining() < Self::ENCODED_LEN {
11323 panic!(
11324 "buffer is too small (need {} bytes, but got {})",
11325 Self::ENCODED_LEN,
11326 __tmp.remaining(),
11327 )
11328 }
11329 __tmp.put_u64_le(self.arming_time_utc);
11330 __tmp.put_u64_le(self.takeoff_time_utc);
11331 __tmp.put_u64_le(self.flight_uuid);
11332 __tmp.put_u32_le(self.time_boot_ms);
11333 __tmp.put_u32_le(self.landing_time);
11334 if matches!(version, MavlinkVersion::V2) {
11335 let len = __tmp.len();
11336 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11337 } else {
11338 __tmp.len()
11339 }
11340 }
11341}
11342#[doc = "id: 144"]
11343#[doc = "Current motion information from a designated system."]
11344#[derive(Debug, Clone, PartialEq)]
11345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11346#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11347pub struct FOLLOW_TARGET_DATA {
11348 #[doc = "Timestamp (time since system boot)."]
11349 pub timestamp: u64,
11350 #[doc = "button states or switches of a tracker device"]
11351 pub custom_state: u64,
11352 #[doc = "Latitude (WGS84)"]
11353 pub lat: i32,
11354 #[doc = "Longitude (WGS84)"]
11355 pub lon: i32,
11356 #[doc = "Altitude (MSL)"]
11357 pub alt: f32,
11358 #[doc = "target velocity (0,0,0) for unknown"]
11359 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11360 pub vel: [f32; 3],
11361 #[doc = "linear target acceleration (0,0,0) for unknown"]
11362 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11363 pub acc: [f32; 3],
11364 #[doc = "(0 0 0 0 for unknown)"]
11365 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11366 pub attitude_q: [f32; 4],
11367 #[doc = "(0 0 0 for unknown)"]
11368 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11369 pub rates: [f32; 3],
11370 #[doc = "eph epv"]
11371 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11372 pub position_cov: [f32; 3],
11373 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11374 pub est_capabilities: u8,
11375}
11376impl FOLLOW_TARGET_DATA {
11377 pub const ENCODED_LEN: usize = 93usize;
11378 pub const DEFAULT: Self = Self {
11379 timestamp: 0_u64,
11380 custom_state: 0_u64,
11381 lat: 0_i32,
11382 lon: 0_i32,
11383 alt: 0.0_f32,
11384 vel: [0.0_f32; 3usize],
11385 acc: [0.0_f32; 3usize],
11386 attitude_q: [0.0_f32; 4usize],
11387 rates: [0.0_f32; 3usize],
11388 position_cov: [0.0_f32; 3usize],
11389 est_capabilities: 0_u8,
11390 };
11391 #[cfg(feature = "arbitrary")]
11392 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11393 use arbitrary::{Arbitrary, Unstructured};
11394 let mut buf = [0u8; 1024];
11395 rng.fill_bytes(&mut buf);
11396 let mut unstructured = Unstructured::new(&buf);
11397 Self::arbitrary(&mut unstructured).unwrap_or_default()
11398 }
11399}
11400impl Default for FOLLOW_TARGET_DATA {
11401 fn default() -> Self {
11402 Self::DEFAULT.clone()
11403 }
11404}
11405impl MessageData for FOLLOW_TARGET_DATA {
11406 type Message = MavMessage;
11407 const ID: u32 = 144u32;
11408 const NAME: &'static str = "FOLLOW_TARGET";
11409 const EXTRA_CRC: u8 = 127u8;
11410 const ENCODED_LEN: usize = 93usize;
11411 fn deser(
11412 _version: MavlinkVersion,
11413 __input: &[u8],
11414 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11415 let avail_len = __input.len();
11416 let mut payload_buf = [0; Self::ENCODED_LEN];
11417 let mut buf = if avail_len < Self::ENCODED_LEN {
11418 payload_buf[0..avail_len].copy_from_slice(__input);
11419 Bytes::new(&payload_buf)
11420 } else {
11421 Bytes::new(__input)
11422 };
11423 let mut __struct = Self::default();
11424 __struct.timestamp = buf.get_u64_le();
11425 __struct.custom_state = buf.get_u64_le();
11426 __struct.lat = buf.get_i32_le();
11427 __struct.lon = buf.get_i32_le();
11428 __struct.alt = buf.get_f32_le();
11429 for v in &mut __struct.vel {
11430 let val = buf.get_f32_le();
11431 *v = val;
11432 }
11433 for v in &mut __struct.acc {
11434 let val = buf.get_f32_le();
11435 *v = val;
11436 }
11437 for v in &mut __struct.attitude_q {
11438 let val = buf.get_f32_le();
11439 *v = val;
11440 }
11441 for v in &mut __struct.rates {
11442 let val = buf.get_f32_le();
11443 *v = val;
11444 }
11445 for v in &mut __struct.position_cov {
11446 let val = buf.get_f32_le();
11447 *v = val;
11448 }
11449 __struct.est_capabilities = buf.get_u8();
11450 Ok(__struct)
11451 }
11452 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11453 let mut __tmp = BytesMut::new(bytes);
11454 #[allow(clippy::absurd_extreme_comparisons)]
11455 #[allow(unused_comparisons)]
11456 if __tmp.remaining() < Self::ENCODED_LEN {
11457 panic!(
11458 "buffer is too small (need {} bytes, but got {})",
11459 Self::ENCODED_LEN,
11460 __tmp.remaining(),
11461 )
11462 }
11463 __tmp.put_u64_le(self.timestamp);
11464 __tmp.put_u64_le(self.custom_state);
11465 __tmp.put_i32_le(self.lat);
11466 __tmp.put_i32_le(self.lon);
11467 __tmp.put_f32_le(self.alt);
11468 for val in &self.vel {
11469 __tmp.put_f32_le(*val);
11470 }
11471 for val in &self.acc {
11472 __tmp.put_f32_le(*val);
11473 }
11474 for val in &self.attitude_q {
11475 __tmp.put_f32_le(*val);
11476 }
11477 for val in &self.rates {
11478 __tmp.put_f32_le(*val);
11479 }
11480 for val in &self.position_cov {
11481 __tmp.put_f32_le(*val);
11482 }
11483 __tmp.put_u8(self.est_capabilities);
11484 if matches!(version, MavlinkVersion::V2) {
11485 let len = __tmp.len();
11486 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11487 } else {
11488 __tmp.len()
11489 }
11490 }
11491}
11492#[doc = "id: 371"]
11493#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
11494#[derive(Debug, Clone, PartialEq)]
11495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11496#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11497pub struct FUEL_STATUS_DATA {
11498 #[doc = "Capacity when full. Must be provided."]
11499 pub maximum_fuel: f32,
11500 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11501 pub consumed_fuel: f32,
11502 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11503 pub remaining_fuel: f32,
11504 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
11505 pub flow_rate: f32,
11506 #[doc = "Fuel temperature. NaN: field not provided."]
11507 pub temperature: f32,
11508 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
11509 pub fuel_type: MavFuelType,
11510 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
11511 pub id: u8,
11512 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
11513 pub percent_remaining: u8,
11514}
11515impl FUEL_STATUS_DATA {
11516 pub const ENCODED_LEN: usize = 26usize;
11517 pub const DEFAULT: Self = Self {
11518 maximum_fuel: 0.0_f32,
11519 consumed_fuel: 0.0_f32,
11520 remaining_fuel: 0.0_f32,
11521 flow_rate: 0.0_f32,
11522 temperature: 0.0_f32,
11523 fuel_type: MavFuelType::DEFAULT,
11524 id: 0_u8,
11525 percent_remaining: 0_u8,
11526 };
11527 #[cfg(feature = "arbitrary")]
11528 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11529 use arbitrary::{Arbitrary, Unstructured};
11530 let mut buf = [0u8; 1024];
11531 rng.fill_bytes(&mut buf);
11532 let mut unstructured = Unstructured::new(&buf);
11533 Self::arbitrary(&mut unstructured).unwrap_or_default()
11534 }
11535}
11536impl Default for FUEL_STATUS_DATA {
11537 fn default() -> Self {
11538 Self::DEFAULT.clone()
11539 }
11540}
11541impl MessageData for FUEL_STATUS_DATA {
11542 type Message = MavMessage;
11543 const ID: u32 = 371u32;
11544 const NAME: &'static str = "FUEL_STATUS";
11545 const EXTRA_CRC: u8 = 10u8;
11546 const ENCODED_LEN: usize = 26usize;
11547 fn deser(
11548 _version: MavlinkVersion,
11549 __input: &[u8],
11550 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11551 let avail_len = __input.len();
11552 let mut payload_buf = [0; Self::ENCODED_LEN];
11553 let mut buf = if avail_len < Self::ENCODED_LEN {
11554 payload_buf[0..avail_len].copy_from_slice(__input);
11555 Bytes::new(&payload_buf)
11556 } else {
11557 Bytes::new(__input)
11558 };
11559 let mut __struct = Self::default();
11560 __struct.maximum_fuel = buf.get_f32_le();
11561 __struct.consumed_fuel = buf.get_f32_le();
11562 __struct.remaining_fuel = buf.get_f32_le();
11563 __struct.flow_rate = buf.get_f32_le();
11564 __struct.temperature = buf.get_f32_le();
11565 let tmp = buf.get_u32_le();
11566 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
11567 ::mavlink_core::error::ParserError::InvalidEnum {
11568 enum_type: "MavFuelType",
11569 value: tmp as u32,
11570 },
11571 )?;
11572 __struct.id = buf.get_u8();
11573 __struct.percent_remaining = buf.get_u8();
11574 Ok(__struct)
11575 }
11576 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11577 let mut __tmp = BytesMut::new(bytes);
11578 #[allow(clippy::absurd_extreme_comparisons)]
11579 #[allow(unused_comparisons)]
11580 if __tmp.remaining() < Self::ENCODED_LEN {
11581 panic!(
11582 "buffer is too small (need {} bytes, but got {})",
11583 Self::ENCODED_LEN,
11584 __tmp.remaining(),
11585 )
11586 }
11587 __tmp.put_f32_le(self.maximum_fuel);
11588 __tmp.put_f32_le(self.consumed_fuel);
11589 __tmp.put_f32_le(self.remaining_fuel);
11590 __tmp.put_f32_le(self.flow_rate);
11591 __tmp.put_f32_le(self.temperature);
11592 __tmp.put_u32_le(self.fuel_type as u32);
11593 __tmp.put_u8(self.id);
11594 __tmp.put_u8(self.percent_remaining);
11595 if matches!(version, MavlinkVersion::V2) {
11596 let len = __tmp.len();
11597 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11598 } else {
11599 __tmp.len()
11600 }
11601 }
11602}
11603#[doc = "id: 373"]
11604#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
11605#[derive(Debug, Clone, PartialEq)]
11606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11607#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11608pub struct GENERATOR_STATUS_DATA {
11609 #[doc = "Status flags."]
11610 pub status: MavGeneratorStatusFlag,
11611 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
11612 pub battery_current: f32,
11613 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
11614 pub load_current: f32,
11615 #[doc = "The power being generated. NaN: field not provided"]
11616 pub power_generated: f32,
11617 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
11618 pub bus_voltage: f32,
11619 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
11620 pub bat_current_setpoint: f32,
11621 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
11622 pub runtime: u32,
11623 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
11624 pub time_until_maintenance: i32,
11625 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
11626 pub generator_speed: u16,
11627 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
11628 pub rectifier_temperature: i16,
11629 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
11630 pub generator_temperature: i16,
11631}
11632impl GENERATOR_STATUS_DATA {
11633 pub const ENCODED_LEN: usize = 42usize;
11634 pub const DEFAULT: Self = Self {
11635 status: MavGeneratorStatusFlag::DEFAULT,
11636 battery_current: 0.0_f32,
11637 load_current: 0.0_f32,
11638 power_generated: 0.0_f32,
11639 bus_voltage: 0.0_f32,
11640 bat_current_setpoint: 0.0_f32,
11641 runtime: 0_u32,
11642 time_until_maintenance: 0_i32,
11643 generator_speed: 0_u16,
11644 rectifier_temperature: 0_i16,
11645 generator_temperature: 0_i16,
11646 };
11647 #[cfg(feature = "arbitrary")]
11648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11649 use arbitrary::{Arbitrary, Unstructured};
11650 let mut buf = [0u8; 1024];
11651 rng.fill_bytes(&mut buf);
11652 let mut unstructured = Unstructured::new(&buf);
11653 Self::arbitrary(&mut unstructured).unwrap_or_default()
11654 }
11655}
11656impl Default for GENERATOR_STATUS_DATA {
11657 fn default() -> Self {
11658 Self::DEFAULT.clone()
11659 }
11660}
11661impl MessageData for GENERATOR_STATUS_DATA {
11662 type Message = MavMessage;
11663 const ID: u32 = 373u32;
11664 const NAME: &'static str = "GENERATOR_STATUS";
11665 const EXTRA_CRC: u8 = 117u8;
11666 const ENCODED_LEN: usize = 42usize;
11667 fn deser(
11668 _version: MavlinkVersion,
11669 __input: &[u8],
11670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11671 let avail_len = __input.len();
11672 let mut payload_buf = [0; Self::ENCODED_LEN];
11673 let mut buf = if avail_len < Self::ENCODED_LEN {
11674 payload_buf[0..avail_len].copy_from_slice(__input);
11675 Bytes::new(&payload_buf)
11676 } else {
11677 Bytes::new(__input)
11678 };
11679 let mut __struct = Self::default();
11680 let tmp = buf.get_u64_le();
11681 __struct.status = MavGeneratorStatusFlag::from_bits(
11682 tmp & MavGeneratorStatusFlag::all().bits(),
11683 )
11684 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11685 flag_type: "MavGeneratorStatusFlag",
11686 value: tmp as u32,
11687 })?;
11688 __struct.battery_current = buf.get_f32_le();
11689 __struct.load_current = buf.get_f32_le();
11690 __struct.power_generated = buf.get_f32_le();
11691 __struct.bus_voltage = buf.get_f32_le();
11692 __struct.bat_current_setpoint = buf.get_f32_le();
11693 __struct.runtime = buf.get_u32_le();
11694 __struct.time_until_maintenance = buf.get_i32_le();
11695 __struct.generator_speed = buf.get_u16_le();
11696 __struct.rectifier_temperature = buf.get_i16_le();
11697 __struct.generator_temperature = buf.get_i16_le();
11698 Ok(__struct)
11699 }
11700 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11701 let mut __tmp = BytesMut::new(bytes);
11702 #[allow(clippy::absurd_extreme_comparisons)]
11703 #[allow(unused_comparisons)]
11704 if __tmp.remaining() < Self::ENCODED_LEN {
11705 panic!(
11706 "buffer is too small (need {} bytes, but got {})",
11707 Self::ENCODED_LEN,
11708 __tmp.remaining(),
11709 )
11710 }
11711 __tmp.put_u64_le(self.status.bits());
11712 __tmp.put_f32_le(self.battery_current);
11713 __tmp.put_f32_le(self.load_current);
11714 __tmp.put_f32_le(self.power_generated);
11715 __tmp.put_f32_le(self.bus_voltage);
11716 __tmp.put_f32_le(self.bat_current_setpoint);
11717 __tmp.put_u32_le(self.runtime);
11718 __tmp.put_i32_le(self.time_until_maintenance);
11719 __tmp.put_u16_le(self.generator_speed);
11720 __tmp.put_i16_le(self.rectifier_temperature);
11721 __tmp.put_i16_le(self.generator_temperature);
11722 if matches!(version, MavlinkVersion::V2) {
11723 let len = __tmp.len();
11724 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11725 } else {
11726 __tmp.len()
11727 }
11728 }
11729}
11730#[doc = "id: 285"]
11731#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
11732#[derive(Debug, Clone, PartialEq)]
11733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11735pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11736 #[doc = "Timestamp (time since system boot)."]
11737 pub time_boot_ms: u32,
11738 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
11739 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11740 pub q: [f32; 4],
11741 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
11742 pub angular_velocity_x: f32,
11743 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
11744 pub angular_velocity_y: f32,
11745 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
11746 pub angular_velocity_z: f32,
11747 #[doc = "Failure flags (0 for no failure)"]
11748 pub failure_flags: GimbalDeviceErrorFlags,
11749 #[doc = "Current gimbal flags set."]
11750 pub flags: GimbalDeviceFlags,
11751 #[doc = "System ID"]
11752 pub target_system: u8,
11753 #[doc = "Component ID"]
11754 pub target_component: u8,
11755 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
11756 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11757 pub delta_yaw: f32,
11758 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
11759 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11760 pub delta_yaw_velocity: f32,
11761 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
11762 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11763 pub gimbal_device_id: u8,
11764}
11765impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11766 pub const ENCODED_LEN: usize = 49usize;
11767 pub const DEFAULT: Self = Self {
11768 time_boot_ms: 0_u32,
11769 q: [0.0_f32; 4usize],
11770 angular_velocity_x: 0.0_f32,
11771 angular_velocity_y: 0.0_f32,
11772 angular_velocity_z: 0.0_f32,
11773 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
11774 flags: GimbalDeviceFlags::DEFAULT,
11775 target_system: 0_u8,
11776 target_component: 0_u8,
11777 delta_yaw: 0.0_f32,
11778 delta_yaw_velocity: 0.0_f32,
11779 gimbal_device_id: 0_u8,
11780 };
11781 #[cfg(feature = "arbitrary")]
11782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11783 use arbitrary::{Arbitrary, Unstructured};
11784 let mut buf = [0u8; 1024];
11785 rng.fill_bytes(&mut buf);
11786 let mut unstructured = Unstructured::new(&buf);
11787 Self::arbitrary(&mut unstructured).unwrap_or_default()
11788 }
11789}
11790impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11791 fn default() -> Self {
11792 Self::DEFAULT.clone()
11793 }
11794}
11795impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11796 type Message = MavMessage;
11797 const ID: u32 = 285u32;
11798 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
11799 const EXTRA_CRC: u8 = 137u8;
11800 const ENCODED_LEN: usize = 49usize;
11801 fn deser(
11802 _version: MavlinkVersion,
11803 __input: &[u8],
11804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11805 let avail_len = __input.len();
11806 let mut payload_buf = [0; Self::ENCODED_LEN];
11807 let mut buf = if avail_len < Self::ENCODED_LEN {
11808 payload_buf[0..avail_len].copy_from_slice(__input);
11809 Bytes::new(&payload_buf)
11810 } else {
11811 Bytes::new(__input)
11812 };
11813 let mut __struct = Self::default();
11814 __struct.time_boot_ms = buf.get_u32_le();
11815 for v in &mut __struct.q {
11816 let val = buf.get_f32_le();
11817 *v = val;
11818 }
11819 __struct.angular_velocity_x = buf.get_f32_le();
11820 __struct.angular_velocity_y = buf.get_f32_le();
11821 __struct.angular_velocity_z = buf.get_f32_le();
11822 let tmp = buf.get_u32_le();
11823 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
11824 tmp & GimbalDeviceErrorFlags::all().bits(),
11825 )
11826 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11827 flag_type: "GimbalDeviceErrorFlags",
11828 value: tmp as u32,
11829 })?;
11830 let tmp = buf.get_u16_le();
11831 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
11832 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11833 flag_type: "GimbalDeviceFlags",
11834 value: tmp as u32,
11835 })?;
11836 __struct.target_system = buf.get_u8();
11837 __struct.target_component = buf.get_u8();
11838 __struct.delta_yaw = buf.get_f32_le();
11839 __struct.delta_yaw_velocity = buf.get_f32_le();
11840 __struct.gimbal_device_id = buf.get_u8();
11841 Ok(__struct)
11842 }
11843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11844 let mut __tmp = BytesMut::new(bytes);
11845 #[allow(clippy::absurd_extreme_comparisons)]
11846 #[allow(unused_comparisons)]
11847 if __tmp.remaining() < Self::ENCODED_LEN {
11848 panic!(
11849 "buffer is too small (need {} bytes, but got {})",
11850 Self::ENCODED_LEN,
11851 __tmp.remaining(),
11852 )
11853 }
11854 __tmp.put_u32_le(self.time_boot_ms);
11855 for val in &self.q {
11856 __tmp.put_f32_le(*val);
11857 }
11858 __tmp.put_f32_le(self.angular_velocity_x);
11859 __tmp.put_f32_le(self.angular_velocity_y);
11860 __tmp.put_f32_le(self.angular_velocity_z);
11861 __tmp.put_u32_le(self.failure_flags.bits());
11862 __tmp.put_u16_le(self.flags.bits());
11863 __tmp.put_u8(self.target_system);
11864 __tmp.put_u8(self.target_component);
11865 __tmp.put_f32_le(self.delta_yaw);
11866 __tmp.put_f32_le(self.delta_yaw_velocity);
11867 __tmp.put_u8(self.gimbal_device_id);
11868 if matches!(version, MavlinkVersion::V2) {
11869 let len = __tmp.len();
11870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11871 } else {
11872 __tmp.len()
11873 }
11874 }
11875}
11876#[doc = "id: 283"]
11877#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
11878#[derive(Debug, Clone, PartialEq)]
11879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11880#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11881pub struct GIMBAL_DEVICE_INFORMATION_DATA {
11882 #[doc = "UID of gimbal hardware (0 if unknown)."]
11883 pub uid: u64,
11884 #[doc = "Timestamp (time since system boot)."]
11885 pub time_boot_ms: u32,
11886 #[doc = "0xff)."]
11887 pub firmware_version: u32,
11888 #[doc = "0xff)."]
11889 pub hardware_version: u32,
11890 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
11891 pub roll_min: f32,
11892 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
11893 pub roll_max: f32,
11894 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
11895 pub pitch_min: f32,
11896 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
11897 pub pitch_max: f32,
11898 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
11899 pub yaw_min: f32,
11900 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
11901 pub yaw_max: f32,
11902 #[doc = "Bitmap of gimbal capability flags."]
11903 pub cap_flags: GimbalDeviceCapFlags,
11904 #[doc = "Bitmap for use for gimbal-specific capability flags."]
11905 pub custom_cap_flags: u16,
11906 #[doc = "Name of the gimbal vendor."]
11907 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11908 pub vendor_name: [u8; 32],
11909 #[doc = "Name of the gimbal model."]
11910 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11911 pub model_name: [u8; 32],
11912 #[doc = "Custom name of the gimbal given to it by the user."]
11913 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11914 pub custom_name: [u8; 32],
11915 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
11916 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11917 pub gimbal_device_id: u8,
11918}
11919impl GIMBAL_DEVICE_INFORMATION_DATA {
11920 pub const ENCODED_LEN: usize = 145usize;
11921 pub const DEFAULT: Self = Self {
11922 uid: 0_u64,
11923 time_boot_ms: 0_u32,
11924 firmware_version: 0_u32,
11925 hardware_version: 0_u32,
11926 roll_min: 0.0_f32,
11927 roll_max: 0.0_f32,
11928 pitch_min: 0.0_f32,
11929 pitch_max: 0.0_f32,
11930 yaw_min: 0.0_f32,
11931 yaw_max: 0.0_f32,
11932 cap_flags: GimbalDeviceCapFlags::DEFAULT,
11933 custom_cap_flags: 0_u16,
11934 vendor_name: [0_u8; 32usize],
11935 model_name: [0_u8; 32usize],
11936 custom_name: [0_u8; 32usize],
11937 gimbal_device_id: 0_u8,
11938 };
11939 #[cfg(feature = "arbitrary")]
11940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11941 use arbitrary::{Arbitrary, Unstructured};
11942 let mut buf = [0u8; 1024];
11943 rng.fill_bytes(&mut buf);
11944 let mut unstructured = Unstructured::new(&buf);
11945 Self::arbitrary(&mut unstructured).unwrap_or_default()
11946 }
11947}
11948impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
11949 fn default() -> Self {
11950 Self::DEFAULT.clone()
11951 }
11952}
11953impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
11954 type Message = MavMessage;
11955 const ID: u32 = 283u32;
11956 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
11957 const EXTRA_CRC: u8 = 74u8;
11958 const ENCODED_LEN: usize = 145usize;
11959 fn deser(
11960 _version: MavlinkVersion,
11961 __input: &[u8],
11962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11963 let avail_len = __input.len();
11964 let mut payload_buf = [0; Self::ENCODED_LEN];
11965 let mut buf = if avail_len < Self::ENCODED_LEN {
11966 payload_buf[0..avail_len].copy_from_slice(__input);
11967 Bytes::new(&payload_buf)
11968 } else {
11969 Bytes::new(__input)
11970 };
11971 let mut __struct = Self::default();
11972 __struct.uid = buf.get_u64_le();
11973 __struct.time_boot_ms = buf.get_u32_le();
11974 __struct.firmware_version = buf.get_u32_le();
11975 __struct.hardware_version = buf.get_u32_le();
11976 __struct.roll_min = buf.get_f32_le();
11977 __struct.roll_max = buf.get_f32_le();
11978 __struct.pitch_min = buf.get_f32_le();
11979 __struct.pitch_max = buf.get_f32_le();
11980 __struct.yaw_min = buf.get_f32_le();
11981 __struct.yaw_max = buf.get_f32_le();
11982 let tmp = buf.get_u16_le();
11983 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
11984 tmp & GimbalDeviceCapFlags::all().bits(),
11985 )
11986 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11987 flag_type: "GimbalDeviceCapFlags",
11988 value: tmp as u32,
11989 })?;
11990 __struct.custom_cap_flags = buf.get_u16_le();
11991 for v in &mut __struct.vendor_name {
11992 let val = buf.get_u8();
11993 *v = val;
11994 }
11995 for v in &mut __struct.model_name {
11996 let val = buf.get_u8();
11997 *v = val;
11998 }
11999 for v in &mut __struct.custom_name {
12000 let val = buf.get_u8();
12001 *v = val;
12002 }
12003 __struct.gimbal_device_id = buf.get_u8();
12004 Ok(__struct)
12005 }
12006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12007 let mut __tmp = BytesMut::new(bytes);
12008 #[allow(clippy::absurd_extreme_comparisons)]
12009 #[allow(unused_comparisons)]
12010 if __tmp.remaining() < Self::ENCODED_LEN {
12011 panic!(
12012 "buffer is too small (need {} bytes, but got {})",
12013 Self::ENCODED_LEN,
12014 __tmp.remaining(),
12015 )
12016 }
12017 __tmp.put_u64_le(self.uid);
12018 __tmp.put_u32_le(self.time_boot_ms);
12019 __tmp.put_u32_le(self.firmware_version);
12020 __tmp.put_u32_le(self.hardware_version);
12021 __tmp.put_f32_le(self.roll_min);
12022 __tmp.put_f32_le(self.roll_max);
12023 __tmp.put_f32_le(self.pitch_min);
12024 __tmp.put_f32_le(self.pitch_max);
12025 __tmp.put_f32_le(self.yaw_min);
12026 __tmp.put_f32_le(self.yaw_max);
12027 __tmp.put_u16_le(self.cap_flags.bits());
12028 __tmp.put_u16_le(self.custom_cap_flags);
12029 for val in &self.vendor_name {
12030 __tmp.put_u8(*val);
12031 }
12032 for val in &self.model_name {
12033 __tmp.put_u8(*val);
12034 }
12035 for val in &self.custom_name {
12036 __tmp.put_u8(*val);
12037 }
12038 __tmp.put_u8(self.gimbal_device_id);
12039 if matches!(version, MavlinkVersion::V2) {
12040 let len = __tmp.len();
12041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12042 } else {
12043 __tmp.len()
12044 }
12045 }
12046}
12047#[doc = "id: 284"]
12048#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12049#[derive(Debug, Clone, PartialEq)]
12050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12052pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12053 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12055 pub q: [f32; 4],
12056 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12057 pub angular_velocity_x: f32,
12058 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12059 pub angular_velocity_y: f32,
12060 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12061 pub angular_velocity_z: f32,
12062 #[doc = "Low level gimbal flags."]
12063 pub flags: GimbalDeviceFlags,
12064 #[doc = "System ID"]
12065 pub target_system: u8,
12066 #[doc = "Component ID"]
12067 pub target_component: u8,
12068}
12069impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12070 pub const ENCODED_LEN: usize = 32usize;
12071 pub const DEFAULT: Self = Self {
12072 q: [0.0_f32; 4usize],
12073 angular_velocity_x: 0.0_f32,
12074 angular_velocity_y: 0.0_f32,
12075 angular_velocity_z: 0.0_f32,
12076 flags: GimbalDeviceFlags::DEFAULT,
12077 target_system: 0_u8,
12078 target_component: 0_u8,
12079 };
12080 #[cfg(feature = "arbitrary")]
12081 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12082 use arbitrary::{Arbitrary, Unstructured};
12083 let mut buf = [0u8; 1024];
12084 rng.fill_bytes(&mut buf);
12085 let mut unstructured = Unstructured::new(&buf);
12086 Self::arbitrary(&mut unstructured).unwrap_or_default()
12087 }
12088}
12089impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12090 fn default() -> Self {
12091 Self::DEFAULT.clone()
12092 }
12093}
12094impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12095 type Message = MavMessage;
12096 const ID: u32 = 284u32;
12097 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12098 const EXTRA_CRC: u8 = 99u8;
12099 const ENCODED_LEN: usize = 32usize;
12100 fn deser(
12101 _version: MavlinkVersion,
12102 __input: &[u8],
12103 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12104 let avail_len = __input.len();
12105 let mut payload_buf = [0; Self::ENCODED_LEN];
12106 let mut buf = if avail_len < Self::ENCODED_LEN {
12107 payload_buf[0..avail_len].copy_from_slice(__input);
12108 Bytes::new(&payload_buf)
12109 } else {
12110 Bytes::new(__input)
12111 };
12112 let mut __struct = Self::default();
12113 for v in &mut __struct.q {
12114 let val = buf.get_f32_le();
12115 *v = val;
12116 }
12117 __struct.angular_velocity_x = buf.get_f32_le();
12118 __struct.angular_velocity_y = buf.get_f32_le();
12119 __struct.angular_velocity_z = buf.get_f32_le();
12120 let tmp = buf.get_u16_le();
12121 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12122 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12123 flag_type: "GimbalDeviceFlags",
12124 value: tmp as u32,
12125 })?;
12126 __struct.target_system = buf.get_u8();
12127 __struct.target_component = buf.get_u8();
12128 Ok(__struct)
12129 }
12130 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12131 let mut __tmp = BytesMut::new(bytes);
12132 #[allow(clippy::absurd_extreme_comparisons)]
12133 #[allow(unused_comparisons)]
12134 if __tmp.remaining() < Self::ENCODED_LEN {
12135 panic!(
12136 "buffer is too small (need {} bytes, but got {})",
12137 Self::ENCODED_LEN,
12138 __tmp.remaining(),
12139 )
12140 }
12141 for val in &self.q {
12142 __tmp.put_f32_le(*val);
12143 }
12144 __tmp.put_f32_le(self.angular_velocity_x);
12145 __tmp.put_f32_le(self.angular_velocity_y);
12146 __tmp.put_f32_le(self.angular_velocity_z);
12147 __tmp.put_u16_le(self.flags.bits());
12148 __tmp.put_u8(self.target_system);
12149 __tmp.put_u8(self.target_component);
12150 if matches!(version, MavlinkVersion::V2) {
12151 let len = __tmp.len();
12152 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12153 } else {
12154 __tmp.len()
12155 }
12156 }
12157}
12158#[doc = "id: 280"]
12159#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12160#[derive(Debug, Clone, PartialEq)]
12161#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12162#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12163pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12164 #[doc = "Timestamp (time since system boot)."]
12165 pub time_boot_ms: u32,
12166 #[doc = "Bitmap of gimbal capability flags."]
12167 pub cap_flags: GimbalManagerCapFlags,
12168 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12169 pub roll_min: f32,
12170 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12171 pub roll_max: f32,
12172 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12173 pub pitch_min: f32,
12174 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12175 pub pitch_max: f32,
12176 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12177 pub yaw_min: f32,
12178 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12179 pub yaw_max: f32,
12180 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12181 pub gimbal_device_id: u8,
12182}
12183impl GIMBAL_MANAGER_INFORMATION_DATA {
12184 pub const ENCODED_LEN: usize = 33usize;
12185 pub const DEFAULT: Self = Self {
12186 time_boot_ms: 0_u32,
12187 cap_flags: GimbalManagerCapFlags::DEFAULT,
12188 roll_min: 0.0_f32,
12189 roll_max: 0.0_f32,
12190 pitch_min: 0.0_f32,
12191 pitch_max: 0.0_f32,
12192 yaw_min: 0.0_f32,
12193 yaw_max: 0.0_f32,
12194 gimbal_device_id: 0_u8,
12195 };
12196 #[cfg(feature = "arbitrary")]
12197 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12198 use arbitrary::{Arbitrary, Unstructured};
12199 let mut buf = [0u8; 1024];
12200 rng.fill_bytes(&mut buf);
12201 let mut unstructured = Unstructured::new(&buf);
12202 Self::arbitrary(&mut unstructured).unwrap_or_default()
12203 }
12204}
12205impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12206 fn default() -> Self {
12207 Self::DEFAULT.clone()
12208 }
12209}
12210impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12211 type Message = MavMessage;
12212 const ID: u32 = 280u32;
12213 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12214 const EXTRA_CRC: u8 = 70u8;
12215 const ENCODED_LEN: usize = 33usize;
12216 fn deser(
12217 _version: MavlinkVersion,
12218 __input: &[u8],
12219 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12220 let avail_len = __input.len();
12221 let mut payload_buf = [0; Self::ENCODED_LEN];
12222 let mut buf = if avail_len < Self::ENCODED_LEN {
12223 payload_buf[0..avail_len].copy_from_slice(__input);
12224 Bytes::new(&payload_buf)
12225 } else {
12226 Bytes::new(__input)
12227 };
12228 let mut __struct = Self::default();
12229 __struct.time_boot_ms = buf.get_u32_le();
12230 let tmp = buf.get_u32_le();
12231 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12232 tmp & GimbalManagerCapFlags::all().bits(),
12233 )
12234 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12235 flag_type: "GimbalManagerCapFlags",
12236 value: tmp as u32,
12237 })?;
12238 __struct.roll_min = buf.get_f32_le();
12239 __struct.roll_max = buf.get_f32_le();
12240 __struct.pitch_min = buf.get_f32_le();
12241 __struct.pitch_max = buf.get_f32_le();
12242 __struct.yaw_min = buf.get_f32_le();
12243 __struct.yaw_max = buf.get_f32_le();
12244 __struct.gimbal_device_id = buf.get_u8();
12245 Ok(__struct)
12246 }
12247 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12248 let mut __tmp = BytesMut::new(bytes);
12249 #[allow(clippy::absurd_extreme_comparisons)]
12250 #[allow(unused_comparisons)]
12251 if __tmp.remaining() < Self::ENCODED_LEN {
12252 panic!(
12253 "buffer is too small (need {} bytes, but got {})",
12254 Self::ENCODED_LEN,
12255 __tmp.remaining(),
12256 )
12257 }
12258 __tmp.put_u32_le(self.time_boot_ms);
12259 __tmp.put_u32_le(self.cap_flags.bits());
12260 __tmp.put_f32_le(self.roll_min);
12261 __tmp.put_f32_le(self.roll_max);
12262 __tmp.put_f32_le(self.pitch_min);
12263 __tmp.put_f32_le(self.pitch_max);
12264 __tmp.put_f32_le(self.yaw_min);
12265 __tmp.put_f32_le(self.yaw_max);
12266 __tmp.put_u8(self.gimbal_device_id);
12267 if matches!(version, MavlinkVersion::V2) {
12268 let len = __tmp.len();
12269 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12270 } else {
12271 __tmp.len()
12272 }
12273 }
12274}
12275#[doc = "id: 282"]
12276#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12277#[derive(Debug, Clone, PartialEq)]
12278#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12280pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12281 #[doc = "High level gimbal manager flags to use."]
12282 pub flags: GimbalManagerFlags,
12283 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12284 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12285 pub q: [f32; 4],
12286 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12287 pub angular_velocity_x: f32,
12288 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12289 pub angular_velocity_y: f32,
12290 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12291 pub angular_velocity_z: f32,
12292 #[doc = "System ID"]
12293 pub target_system: u8,
12294 #[doc = "Component ID"]
12295 pub target_component: u8,
12296 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12297 pub gimbal_device_id: u8,
12298}
12299impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12300 pub const ENCODED_LEN: usize = 35usize;
12301 pub const DEFAULT: Self = Self {
12302 flags: GimbalManagerFlags::DEFAULT,
12303 q: [0.0_f32; 4usize],
12304 angular_velocity_x: 0.0_f32,
12305 angular_velocity_y: 0.0_f32,
12306 angular_velocity_z: 0.0_f32,
12307 target_system: 0_u8,
12308 target_component: 0_u8,
12309 gimbal_device_id: 0_u8,
12310 };
12311 #[cfg(feature = "arbitrary")]
12312 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12313 use arbitrary::{Arbitrary, Unstructured};
12314 let mut buf = [0u8; 1024];
12315 rng.fill_bytes(&mut buf);
12316 let mut unstructured = Unstructured::new(&buf);
12317 Self::arbitrary(&mut unstructured).unwrap_or_default()
12318 }
12319}
12320impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12321 fn default() -> Self {
12322 Self::DEFAULT.clone()
12323 }
12324}
12325impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12326 type Message = MavMessage;
12327 const ID: u32 = 282u32;
12328 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12329 const EXTRA_CRC: u8 = 123u8;
12330 const ENCODED_LEN: usize = 35usize;
12331 fn deser(
12332 _version: MavlinkVersion,
12333 __input: &[u8],
12334 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12335 let avail_len = __input.len();
12336 let mut payload_buf = [0; Self::ENCODED_LEN];
12337 let mut buf = if avail_len < Self::ENCODED_LEN {
12338 payload_buf[0..avail_len].copy_from_slice(__input);
12339 Bytes::new(&payload_buf)
12340 } else {
12341 Bytes::new(__input)
12342 };
12343 let mut __struct = Self::default();
12344 let tmp = buf.get_u32_le();
12345 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12346 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12347 flag_type: "GimbalManagerFlags",
12348 value: tmp as u32,
12349 })?;
12350 for v in &mut __struct.q {
12351 let val = buf.get_f32_le();
12352 *v = val;
12353 }
12354 __struct.angular_velocity_x = buf.get_f32_le();
12355 __struct.angular_velocity_y = buf.get_f32_le();
12356 __struct.angular_velocity_z = buf.get_f32_le();
12357 __struct.target_system = buf.get_u8();
12358 __struct.target_component = buf.get_u8();
12359 __struct.gimbal_device_id = buf.get_u8();
12360 Ok(__struct)
12361 }
12362 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12363 let mut __tmp = BytesMut::new(bytes);
12364 #[allow(clippy::absurd_extreme_comparisons)]
12365 #[allow(unused_comparisons)]
12366 if __tmp.remaining() < Self::ENCODED_LEN {
12367 panic!(
12368 "buffer is too small (need {} bytes, but got {})",
12369 Self::ENCODED_LEN,
12370 __tmp.remaining(),
12371 )
12372 }
12373 __tmp.put_u32_le(self.flags.bits());
12374 for val in &self.q {
12375 __tmp.put_f32_le(*val);
12376 }
12377 __tmp.put_f32_le(self.angular_velocity_x);
12378 __tmp.put_f32_le(self.angular_velocity_y);
12379 __tmp.put_f32_le(self.angular_velocity_z);
12380 __tmp.put_u8(self.target_system);
12381 __tmp.put_u8(self.target_component);
12382 __tmp.put_u8(self.gimbal_device_id);
12383 if matches!(version, MavlinkVersion::V2) {
12384 let len = __tmp.len();
12385 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12386 } else {
12387 __tmp.len()
12388 }
12389 }
12390}
12391#[doc = "id: 288"]
12392#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12393#[derive(Debug, Clone, PartialEq)]
12394#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12396pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12397 #[doc = "High level gimbal manager flags."]
12398 pub flags: GimbalManagerFlags,
12399 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12400 pub pitch: f32,
12401 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12402 pub yaw: f32,
12403 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12404 pub pitch_rate: f32,
12405 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12406 pub yaw_rate: f32,
12407 #[doc = "System ID"]
12408 pub target_system: u8,
12409 #[doc = "Component ID"]
12410 pub target_component: u8,
12411 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12412 pub gimbal_device_id: u8,
12413}
12414impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12415 pub const ENCODED_LEN: usize = 23usize;
12416 pub const DEFAULT: Self = Self {
12417 flags: GimbalManagerFlags::DEFAULT,
12418 pitch: 0.0_f32,
12419 yaw: 0.0_f32,
12420 pitch_rate: 0.0_f32,
12421 yaw_rate: 0.0_f32,
12422 target_system: 0_u8,
12423 target_component: 0_u8,
12424 gimbal_device_id: 0_u8,
12425 };
12426 #[cfg(feature = "arbitrary")]
12427 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12428 use arbitrary::{Arbitrary, Unstructured};
12429 let mut buf = [0u8; 1024];
12430 rng.fill_bytes(&mut buf);
12431 let mut unstructured = Unstructured::new(&buf);
12432 Self::arbitrary(&mut unstructured).unwrap_or_default()
12433 }
12434}
12435impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12436 fn default() -> Self {
12437 Self::DEFAULT.clone()
12438 }
12439}
12440impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12441 type Message = MavMessage;
12442 const ID: u32 = 288u32;
12443 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
12444 const EXTRA_CRC: u8 = 20u8;
12445 const ENCODED_LEN: usize = 23usize;
12446 fn deser(
12447 _version: MavlinkVersion,
12448 __input: &[u8],
12449 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12450 let avail_len = __input.len();
12451 let mut payload_buf = [0; Self::ENCODED_LEN];
12452 let mut buf = if avail_len < Self::ENCODED_LEN {
12453 payload_buf[0..avail_len].copy_from_slice(__input);
12454 Bytes::new(&payload_buf)
12455 } else {
12456 Bytes::new(__input)
12457 };
12458 let mut __struct = Self::default();
12459 let tmp = buf.get_u32_le();
12460 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12461 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12462 flag_type: "GimbalManagerFlags",
12463 value: tmp as u32,
12464 })?;
12465 __struct.pitch = buf.get_f32_le();
12466 __struct.yaw = buf.get_f32_le();
12467 __struct.pitch_rate = buf.get_f32_le();
12468 __struct.yaw_rate = buf.get_f32_le();
12469 __struct.target_system = buf.get_u8();
12470 __struct.target_component = buf.get_u8();
12471 __struct.gimbal_device_id = buf.get_u8();
12472 Ok(__struct)
12473 }
12474 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12475 let mut __tmp = BytesMut::new(bytes);
12476 #[allow(clippy::absurd_extreme_comparisons)]
12477 #[allow(unused_comparisons)]
12478 if __tmp.remaining() < Self::ENCODED_LEN {
12479 panic!(
12480 "buffer is too small (need {} bytes, but got {})",
12481 Self::ENCODED_LEN,
12482 __tmp.remaining(),
12483 )
12484 }
12485 __tmp.put_u32_le(self.flags.bits());
12486 __tmp.put_f32_le(self.pitch);
12487 __tmp.put_f32_le(self.yaw);
12488 __tmp.put_f32_le(self.pitch_rate);
12489 __tmp.put_f32_le(self.yaw_rate);
12490 __tmp.put_u8(self.target_system);
12491 __tmp.put_u8(self.target_component);
12492 __tmp.put_u8(self.gimbal_device_id);
12493 if matches!(version, MavlinkVersion::V2) {
12494 let len = __tmp.len();
12495 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12496 } else {
12497 __tmp.len()
12498 }
12499 }
12500}
12501#[doc = "id: 287"]
12502#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
12503#[derive(Debug, Clone, PartialEq)]
12504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12505#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12506pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12507 #[doc = "High level gimbal manager flags to use."]
12508 pub flags: GimbalManagerFlags,
12509 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
12510 pub pitch: f32,
12511 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
12512 pub yaw: f32,
12513 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
12514 pub pitch_rate: f32,
12515 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
12516 pub yaw_rate: f32,
12517 #[doc = "System ID"]
12518 pub target_system: u8,
12519 #[doc = "Component ID"]
12520 pub target_component: u8,
12521 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12522 pub gimbal_device_id: u8,
12523}
12524impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12525 pub const ENCODED_LEN: usize = 23usize;
12526 pub const DEFAULT: Self = Self {
12527 flags: GimbalManagerFlags::DEFAULT,
12528 pitch: 0.0_f32,
12529 yaw: 0.0_f32,
12530 pitch_rate: 0.0_f32,
12531 yaw_rate: 0.0_f32,
12532 target_system: 0_u8,
12533 target_component: 0_u8,
12534 gimbal_device_id: 0_u8,
12535 };
12536 #[cfg(feature = "arbitrary")]
12537 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12538 use arbitrary::{Arbitrary, Unstructured};
12539 let mut buf = [0u8; 1024];
12540 rng.fill_bytes(&mut buf);
12541 let mut unstructured = Unstructured::new(&buf);
12542 Self::arbitrary(&mut unstructured).unwrap_or_default()
12543 }
12544}
12545impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12546 fn default() -> Self {
12547 Self::DEFAULT.clone()
12548 }
12549}
12550impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12551 type Message = MavMessage;
12552 const ID: u32 = 287u32;
12553 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
12554 const EXTRA_CRC: u8 = 1u8;
12555 const ENCODED_LEN: usize = 23usize;
12556 fn deser(
12557 _version: MavlinkVersion,
12558 __input: &[u8],
12559 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12560 let avail_len = __input.len();
12561 let mut payload_buf = [0; Self::ENCODED_LEN];
12562 let mut buf = if avail_len < Self::ENCODED_LEN {
12563 payload_buf[0..avail_len].copy_from_slice(__input);
12564 Bytes::new(&payload_buf)
12565 } else {
12566 Bytes::new(__input)
12567 };
12568 let mut __struct = Self::default();
12569 let tmp = buf.get_u32_le();
12570 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12571 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12572 flag_type: "GimbalManagerFlags",
12573 value: tmp as u32,
12574 })?;
12575 __struct.pitch = buf.get_f32_le();
12576 __struct.yaw = buf.get_f32_le();
12577 __struct.pitch_rate = buf.get_f32_le();
12578 __struct.yaw_rate = buf.get_f32_le();
12579 __struct.target_system = buf.get_u8();
12580 __struct.target_component = buf.get_u8();
12581 __struct.gimbal_device_id = buf.get_u8();
12582 Ok(__struct)
12583 }
12584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12585 let mut __tmp = BytesMut::new(bytes);
12586 #[allow(clippy::absurd_extreme_comparisons)]
12587 #[allow(unused_comparisons)]
12588 if __tmp.remaining() < Self::ENCODED_LEN {
12589 panic!(
12590 "buffer is too small (need {} bytes, but got {})",
12591 Self::ENCODED_LEN,
12592 __tmp.remaining(),
12593 )
12594 }
12595 __tmp.put_u32_le(self.flags.bits());
12596 __tmp.put_f32_le(self.pitch);
12597 __tmp.put_f32_le(self.yaw);
12598 __tmp.put_f32_le(self.pitch_rate);
12599 __tmp.put_f32_le(self.yaw_rate);
12600 __tmp.put_u8(self.target_system);
12601 __tmp.put_u8(self.target_component);
12602 __tmp.put_u8(self.gimbal_device_id);
12603 if matches!(version, MavlinkVersion::V2) {
12604 let len = __tmp.len();
12605 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12606 } else {
12607 __tmp.len()
12608 }
12609 }
12610}
12611#[doc = "id: 281"]
12612#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
12613#[derive(Debug, Clone, PartialEq)]
12614#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12615#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12616pub struct GIMBAL_MANAGER_STATUS_DATA {
12617 #[doc = "Timestamp (time since system boot)."]
12618 pub time_boot_ms: u32,
12619 #[doc = "High level gimbal manager flags currently applied."]
12620 pub flags: GimbalManagerFlags,
12621 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12622 pub gimbal_device_id: u8,
12623 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
12624 pub primary_control_sysid: u8,
12625 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
12626 pub primary_control_compid: u8,
12627 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
12628 pub secondary_control_sysid: u8,
12629 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
12630 pub secondary_control_compid: u8,
12631}
12632impl GIMBAL_MANAGER_STATUS_DATA {
12633 pub const ENCODED_LEN: usize = 13usize;
12634 pub const DEFAULT: Self = Self {
12635 time_boot_ms: 0_u32,
12636 flags: GimbalManagerFlags::DEFAULT,
12637 gimbal_device_id: 0_u8,
12638 primary_control_sysid: 0_u8,
12639 primary_control_compid: 0_u8,
12640 secondary_control_sysid: 0_u8,
12641 secondary_control_compid: 0_u8,
12642 };
12643 #[cfg(feature = "arbitrary")]
12644 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12645 use arbitrary::{Arbitrary, Unstructured};
12646 let mut buf = [0u8; 1024];
12647 rng.fill_bytes(&mut buf);
12648 let mut unstructured = Unstructured::new(&buf);
12649 Self::arbitrary(&mut unstructured).unwrap_or_default()
12650 }
12651}
12652impl Default for GIMBAL_MANAGER_STATUS_DATA {
12653 fn default() -> Self {
12654 Self::DEFAULT.clone()
12655 }
12656}
12657impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
12658 type Message = MavMessage;
12659 const ID: u32 = 281u32;
12660 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
12661 const EXTRA_CRC: u8 = 48u8;
12662 const ENCODED_LEN: usize = 13usize;
12663 fn deser(
12664 _version: MavlinkVersion,
12665 __input: &[u8],
12666 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12667 let avail_len = __input.len();
12668 let mut payload_buf = [0; Self::ENCODED_LEN];
12669 let mut buf = if avail_len < Self::ENCODED_LEN {
12670 payload_buf[0..avail_len].copy_from_slice(__input);
12671 Bytes::new(&payload_buf)
12672 } else {
12673 Bytes::new(__input)
12674 };
12675 let mut __struct = Self::default();
12676 __struct.time_boot_ms = buf.get_u32_le();
12677 let tmp = buf.get_u32_le();
12678 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12679 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12680 flag_type: "GimbalManagerFlags",
12681 value: tmp as u32,
12682 })?;
12683 __struct.gimbal_device_id = buf.get_u8();
12684 __struct.primary_control_sysid = buf.get_u8();
12685 __struct.primary_control_compid = buf.get_u8();
12686 __struct.secondary_control_sysid = buf.get_u8();
12687 __struct.secondary_control_compid = buf.get_u8();
12688 Ok(__struct)
12689 }
12690 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12691 let mut __tmp = BytesMut::new(bytes);
12692 #[allow(clippy::absurd_extreme_comparisons)]
12693 #[allow(unused_comparisons)]
12694 if __tmp.remaining() < Self::ENCODED_LEN {
12695 panic!(
12696 "buffer is too small (need {} bytes, but got {})",
12697 Self::ENCODED_LEN,
12698 __tmp.remaining(),
12699 )
12700 }
12701 __tmp.put_u32_le(self.time_boot_ms);
12702 __tmp.put_u32_le(self.flags.bits());
12703 __tmp.put_u8(self.gimbal_device_id);
12704 __tmp.put_u8(self.primary_control_sysid);
12705 __tmp.put_u8(self.primary_control_compid);
12706 __tmp.put_u8(self.secondary_control_sysid);
12707 __tmp.put_u8(self.secondary_control_compid);
12708 if matches!(version, MavlinkVersion::V2) {
12709 let len = __tmp.len();
12710 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12711 } else {
12712 __tmp.len()
12713 }
12714 }
12715}
12716#[doc = "id: 33"]
12717#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
12718#[derive(Debug, Clone, PartialEq)]
12719#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12720#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12721pub struct GLOBAL_POSITION_INT_DATA {
12722 #[doc = "Timestamp (time since system boot)."]
12723 pub time_boot_ms: u32,
12724 #[doc = "Latitude, expressed"]
12725 pub lat: i32,
12726 #[doc = "Longitude, expressed"]
12727 pub lon: i32,
12728 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
12729 pub alt: i32,
12730 #[doc = "Altitude above home"]
12731 pub relative_alt: i32,
12732 #[doc = "Ground X Speed (Latitude, positive north)"]
12733 pub vx: i16,
12734 #[doc = "Ground Y Speed (Longitude, positive east)"]
12735 pub vy: i16,
12736 #[doc = "Ground Z Speed (Altitude, positive down)"]
12737 pub vz: i16,
12738 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
12739 pub hdg: u16,
12740}
12741impl GLOBAL_POSITION_INT_DATA {
12742 pub const ENCODED_LEN: usize = 28usize;
12743 pub const DEFAULT: Self = Self {
12744 time_boot_ms: 0_u32,
12745 lat: 0_i32,
12746 lon: 0_i32,
12747 alt: 0_i32,
12748 relative_alt: 0_i32,
12749 vx: 0_i16,
12750 vy: 0_i16,
12751 vz: 0_i16,
12752 hdg: 0_u16,
12753 };
12754 #[cfg(feature = "arbitrary")]
12755 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12756 use arbitrary::{Arbitrary, Unstructured};
12757 let mut buf = [0u8; 1024];
12758 rng.fill_bytes(&mut buf);
12759 let mut unstructured = Unstructured::new(&buf);
12760 Self::arbitrary(&mut unstructured).unwrap_or_default()
12761 }
12762}
12763impl Default for GLOBAL_POSITION_INT_DATA {
12764 fn default() -> Self {
12765 Self::DEFAULT.clone()
12766 }
12767}
12768impl MessageData for GLOBAL_POSITION_INT_DATA {
12769 type Message = MavMessage;
12770 const ID: u32 = 33u32;
12771 const NAME: &'static str = "GLOBAL_POSITION_INT";
12772 const EXTRA_CRC: u8 = 104u8;
12773 const ENCODED_LEN: usize = 28usize;
12774 fn deser(
12775 _version: MavlinkVersion,
12776 __input: &[u8],
12777 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12778 let avail_len = __input.len();
12779 let mut payload_buf = [0; Self::ENCODED_LEN];
12780 let mut buf = if avail_len < Self::ENCODED_LEN {
12781 payload_buf[0..avail_len].copy_from_slice(__input);
12782 Bytes::new(&payload_buf)
12783 } else {
12784 Bytes::new(__input)
12785 };
12786 let mut __struct = Self::default();
12787 __struct.time_boot_ms = buf.get_u32_le();
12788 __struct.lat = buf.get_i32_le();
12789 __struct.lon = buf.get_i32_le();
12790 __struct.alt = buf.get_i32_le();
12791 __struct.relative_alt = buf.get_i32_le();
12792 __struct.vx = buf.get_i16_le();
12793 __struct.vy = buf.get_i16_le();
12794 __struct.vz = buf.get_i16_le();
12795 __struct.hdg = buf.get_u16_le();
12796 Ok(__struct)
12797 }
12798 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12799 let mut __tmp = BytesMut::new(bytes);
12800 #[allow(clippy::absurd_extreme_comparisons)]
12801 #[allow(unused_comparisons)]
12802 if __tmp.remaining() < Self::ENCODED_LEN {
12803 panic!(
12804 "buffer is too small (need {} bytes, but got {})",
12805 Self::ENCODED_LEN,
12806 __tmp.remaining(),
12807 )
12808 }
12809 __tmp.put_u32_le(self.time_boot_ms);
12810 __tmp.put_i32_le(self.lat);
12811 __tmp.put_i32_le(self.lon);
12812 __tmp.put_i32_le(self.alt);
12813 __tmp.put_i32_le(self.relative_alt);
12814 __tmp.put_i16_le(self.vx);
12815 __tmp.put_i16_le(self.vy);
12816 __tmp.put_i16_le(self.vz);
12817 __tmp.put_u16_le(self.hdg);
12818 if matches!(version, MavlinkVersion::V2) {
12819 let len = __tmp.len();
12820 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12821 } else {
12822 __tmp.len()
12823 }
12824 }
12825}
12826#[doc = "id: 63"]
12827#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
12828#[derive(Debug, Clone, PartialEq)]
12829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12831pub struct GLOBAL_POSITION_INT_COV_DATA {
12832 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12833 pub time_usec: u64,
12834 #[doc = "Latitude"]
12835 pub lat: i32,
12836 #[doc = "Longitude"]
12837 pub lon: i32,
12838 #[doc = "Altitude in meters above MSL"]
12839 pub alt: i32,
12840 #[doc = "Altitude above ground"]
12841 pub relative_alt: i32,
12842 #[doc = "Ground X Speed (Latitude)"]
12843 pub vx: f32,
12844 #[doc = "Ground Y Speed (Longitude)"]
12845 pub vy: f32,
12846 #[doc = "Ground Z Speed (Altitude)"]
12847 pub vz: f32,
12848 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
12849 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12850 pub covariance: [f32; 36],
12851 #[doc = "Class id of the estimator this estimate originated from."]
12852 pub estimator_type: MavEstimatorType,
12853}
12854impl GLOBAL_POSITION_INT_COV_DATA {
12855 pub const ENCODED_LEN: usize = 181usize;
12856 pub const DEFAULT: Self = Self {
12857 time_usec: 0_u64,
12858 lat: 0_i32,
12859 lon: 0_i32,
12860 alt: 0_i32,
12861 relative_alt: 0_i32,
12862 vx: 0.0_f32,
12863 vy: 0.0_f32,
12864 vz: 0.0_f32,
12865 covariance: [0.0_f32; 36usize],
12866 estimator_type: MavEstimatorType::DEFAULT,
12867 };
12868 #[cfg(feature = "arbitrary")]
12869 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12870 use arbitrary::{Arbitrary, Unstructured};
12871 let mut buf = [0u8; 1024];
12872 rng.fill_bytes(&mut buf);
12873 let mut unstructured = Unstructured::new(&buf);
12874 Self::arbitrary(&mut unstructured).unwrap_or_default()
12875 }
12876}
12877impl Default for GLOBAL_POSITION_INT_COV_DATA {
12878 fn default() -> Self {
12879 Self::DEFAULT.clone()
12880 }
12881}
12882impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
12883 type Message = MavMessage;
12884 const ID: u32 = 63u32;
12885 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
12886 const EXTRA_CRC: u8 = 119u8;
12887 const ENCODED_LEN: usize = 181usize;
12888 fn deser(
12889 _version: MavlinkVersion,
12890 __input: &[u8],
12891 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12892 let avail_len = __input.len();
12893 let mut payload_buf = [0; Self::ENCODED_LEN];
12894 let mut buf = if avail_len < Self::ENCODED_LEN {
12895 payload_buf[0..avail_len].copy_from_slice(__input);
12896 Bytes::new(&payload_buf)
12897 } else {
12898 Bytes::new(__input)
12899 };
12900 let mut __struct = Self::default();
12901 __struct.time_usec = buf.get_u64_le();
12902 __struct.lat = buf.get_i32_le();
12903 __struct.lon = buf.get_i32_le();
12904 __struct.alt = buf.get_i32_le();
12905 __struct.relative_alt = buf.get_i32_le();
12906 __struct.vx = buf.get_f32_le();
12907 __struct.vy = buf.get_f32_le();
12908 __struct.vz = buf.get_f32_le();
12909 for v in &mut __struct.covariance {
12910 let val = buf.get_f32_le();
12911 *v = val;
12912 }
12913 let tmp = buf.get_u8();
12914 __struct.estimator_type =
12915 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12916 enum_type: "MavEstimatorType",
12917 value: tmp as u32,
12918 })?;
12919 Ok(__struct)
12920 }
12921 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12922 let mut __tmp = BytesMut::new(bytes);
12923 #[allow(clippy::absurd_extreme_comparisons)]
12924 #[allow(unused_comparisons)]
12925 if __tmp.remaining() < Self::ENCODED_LEN {
12926 panic!(
12927 "buffer is too small (need {} bytes, but got {})",
12928 Self::ENCODED_LEN,
12929 __tmp.remaining(),
12930 )
12931 }
12932 __tmp.put_u64_le(self.time_usec);
12933 __tmp.put_i32_le(self.lat);
12934 __tmp.put_i32_le(self.lon);
12935 __tmp.put_i32_le(self.alt);
12936 __tmp.put_i32_le(self.relative_alt);
12937 __tmp.put_f32_le(self.vx);
12938 __tmp.put_f32_le(self.vy);
12939 __tmp.put_f32_le(self.vz);
12940 for val in &self.covariance {
12941 __tmp.put_f32_le(*val);
12942 }
12943 __tmp.put_u8(self.estimator_type as u8);
12944 if matches!(version, MavlinkVersion::V2) {
12945 let len = __tmp.len();
12946 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12947 } else {
12948 __tmp.len()
12949 }
12950 }
12951}
12952#[doc = "id: 101"]
12953#[doc = "Global position/attitude estimate from a vision source."]
12954#[derive(Debug, Clone, PartialEq)]
12955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12957pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
12958 #[doc = "Timestamp (UNIX time or since system boot)"]
12959 pub usec: u64,
12960 #[doc = "Global X position"]
12961 pub x: f32,
12962 #[doc = "Global Y position"]
12963 pub y: f32,
12964 #[doc = "Global Z position"]
12965 pub z: f32,
12966 #[doc = "Roll angle"]
12967 pub roll: f32,
12968 #[doc = "Pitch angle"]
12969 pub pitch: f32,
12970 #[doc = "Yaw angle"]
12971 pub yaw: f32,
12972 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
12973 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12974 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12975 pub covariance: [f32; 21],
12976 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
12977 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12978 pub reset_counter: u8,
12979}
12980impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
12981 pub const ENCODED_LEN: usize = 117usize;
12982 pub const DEFAULT: Self = Self {
12983 usec: 0_u64,
12984 x: 0.0_f32,
12985 y: 0.0_f32,
12986 z: 0.0_f32,
12987 roll: 0.0_f32,
12988 pitch: 0.0_f32,
12989 yaw: 0.0_f32,
12990 covariance: [0.0_f32; 21usize],
12991 reset_counter: 0_u8,
12992 };
12993 #[cfg(feature = "arbitrary")]
12994 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12995 use arbitrary::{Arbitrary, Unstructured};
12996 let mut buf = [0u8; 1024];
12997 rng.fill_bytes(&mut buf);
12998 let mut unstructured = Unstructured::new(&buf);
12999 Self::arbitrary(&mut unstructured).unwrap_or_default()
13000 }
13001}
13002impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13003 fn default() -> Self {
13004 Self::DEFAULT.clone()
13005 }
13006}
13007impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13008 type Message = MavMessage;
13009 const ID: u32 = 101u32;
13010 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13011 const EXTRA_CRC: u8 = 102u8;
13012 const ENCODED_LEN: usize = 117usize;
13013 fn deser(
13014 _version: MavlinkVersion,
13015 __input: &[u8],
13016 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13017 let avail_len = __input.len();
13018 let mut payload_buf = [0; Self::ENCODED_LEN];
13019 let mut buf = if avail_len < Self::ENCODED_LEN {
13020 payload_buf[0..avail_len].copy_from_slice(__input);
13021 Bytes::new(&payload_buf)
13022 } else {
13023 Bytes::new(__input)
13024 };
13025 let mut __struct = Self::default();
13026 __struct.usec = buf.get_u64_le();
13027 __struct.x = buf.get_f32_le();
13028 __struct.y = buf.get_f32_le();
13029 __struct.z = buf.get_f32_le();
13030 __struct.roll = buf.get_f32_le();
13031 __struct.pitch = buf.get_f32_le();
13032 __struct.yaw = buf.get_f32_le();
13033 for v in &mut __struct.covariance {
13034 let val = buf.get_f32_le();
13035 *v = val;
13036 }
13037 __struct.reset_counter = buf.get_u8();
13038 Ok(__struct)
13039 }
13040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13041 let mut __tmp = BytesMut::new(bytes);
13042 #[allow(clippy::absurd_extreme_comparisons)]
13043 #[allow(unused_comparisons)]
13044 if __tmp.remaining() < Self::ENCODED_LEN {
13045 panic!(
13046 "buffer is too small (need {} bytes, but got {})",
13047 Self::ENCODED_LEN,
13048 __tmp.remaining(),
13049 )
13050 }
13051 __tmp.put_u64_le(self.usec);
13052 __tmp.put_f32_le(self.x);
13053 __tmp.put_f32_le(self.y);
13054 __tmp.put_f32_le(self.z);
13055 __tmp.put_f32_le(self.roll);
13056 __tmp.put_f32_le(self.pitch);
13057 __tmp.put_f32_le(self.yaw);
13058 for val in &self.covariance {
13059 __tmp.put_f32_le(*val);
13060 }
13061 __tmp.put_u8(self.reset_counter);
13062 if matches!(version, MavlinkVersion::V2) {
13063 let len = __tmp.len();
13064 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13065 } else {
13066 __tmp.len()
13067 }
13068 }
13069}
13070#[doc = "id: 124"]
13071#[doc = "Second GPS data."]
13072#[derive(Debug, Clone, PartialEq)]
13073#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13074#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13075pub struct GPS2_RAW_DATA {
13076 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13077 pub time_usec: u64,
13078 #[doc = "Latitude (WGS84)"]
13079 pub lat: i32,
13080 #[doc = "Longitude (WGS84)"]
13081 pub lon: i32,
13082 #[doc = "Altitude (MSL). Positive for up."]
13083 pub alt: i32,
13084 #[doc = "Age of DGPS info"]
13085 pub dgps_age: u32,
13086 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13087 pub eph: u16,
13088 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13089 pub epv: u16,
13090 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13091 pub vel: u16,
13092 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13093 pub cog: u16,
13094 #[doc = "GPS fix type."]
13095 pub fix_type: GpsFixType,
13096 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13097 pub satellites_visible: u8,
13098 #[doc = "Number of DGPS satellites"]
13099 pub dgps_numch: u8,
13100 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13101 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13102 pub yaw: u16,
13103 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13104 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13105 pub alt_ellipsoid: i32,
13106 #[doc = "Position uncertainty."]
13107 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13108 pub h_acc: u32,
13109 #[doc = "Altitude uncertainty."]
13110 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13111 pub v_acc: u32,
13112 #[doc = "Speed uncertainty."]
13113 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13114 pub vel_acc: u32,
13115 #[doc = "Heading / track uncertainty"]
13116 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13117 pub hdg_acc: u32,
13118}
13119impl GPS2_RAW_DATA {
13120 pub const ENCODED_LEN: usize = 57usize;
13121 pub const DEFAULT: Self = Self {
13122 time_usec: 0_u64,
13123 lat: 0_i32,
13124 lon: 0_i32,
13125 alt: 0_i32,
13126 dgps_age: 0_u32,
13127 eph: 0_u16,
13128 epv: 0_u16,
13129 vel: 0_u16,
13130 cog: 0_u16,
13131 fix_type: GpsFixType::DEFAULT,
13132 satellites_visible: 0_u8,
13133 dgps_numch: 0_u8,
13134 yaw: 0_u16,
13135 alt_ellipsoid: 0_i32,
13136 h_acc: 0_u32,
13137 v_acc: 0_u32,
13138 vel_acc: 0_u32,
13139 hdg_acc: 0_u32,
13140 };
13141 #[cfg(feature = "arbitrary")]
13142 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13143 use arbitrary::{Arbitrary, Unstructured};
13144 let mut buf = [0u8; 1024];
13145 rng.fill_bytes(&mut buf);
13146 let mut unstructured = Unstructured::new(&buf);
13147 Self::arbitrary(&mut unstructured).unwrap_or_default()
13148 }
13149}
13150impl Default for GPS2_RAW_DATA {
13151 fn default() -> Self {
13152 Self::DEFAULT.clone()
13153 }
13154}
13155impl MessageData for GPS2_RAW_DATA {
13156 type Message = MavMessage;
13157 const ID: u32 = 124u32;
13158 const NAME: &'static str = "GPS2_RAW";
13159 const EXTRA_CRC: u8 = 87u8;
13160 const ENCODED_LEN: usize = 57usize;
13161 fn deser(
13162 _version: MavlinkVersion,
13163 __input: &[u8],
13164 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13165 let avail_len = __input.len();
13166 let mut payload_buf = [0; Self::ENCODED_LEN];
13167 let mut buf = if avail_len < Self::ENCODED_LEN {
13168 payload_buf[0..avail_len].copy_from_slice(__input);
13169 Bytes::new(&payload_buf)
13170 } else {
13171 Bytes::new(__input)
13172 };
13173 let mut __struct = Self::default();
13174 __struct.time_usec = buf.get_u64_le();
13175 __struct.lat = buf.get_i32_le();
13176 __struct.lon = buf.get_i32_le();
13177 __struct.alt = buf.get_i32_le();
13178 __struct.dgps_age = buf.get_u32_le();
13179 __struct.eph = buf.get_u16_le();
13180 __struct.epv = buf.get_u16_le();
13181 __struct.vel = buf.get_u16_le();
13182 __struct.cog = buf.get_u16_le();
13183 let tmp = buf.get_u8();
13184 __struct.fix_type =
13185 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13186 enum_type: "GpsFixType",
13187 value: tmp as u32,
13188 })?;
13189 __struct.satellites_visible = buf.get_u8();
13190 __struct.dgps_numch = buf.get_u8();
13191 __struct.yaw = buf.get_u16_le();
13192 __struct.alt_ellipsoid = buf.get_i32_le();
13193 __struct.h_acc = buf.get_u32_le();
13194 __struct.v_acc = buf.get_u32_le();
13195 __struct.vel_acc = buf.get_u32_le();
13196 __struct.hdg_acc = buf.get_u32_le();
13197 Ok(__struct)
13198 }
13199 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13200 let mut __tmp = BytesMut::new(bytes);
13201 #[allow(clippy::absurd_extreme_comparisons)]
13202 #[allow(unused_comparisons)]
13203 if __tmp.remaining() < Self::ENCODED_LEN {
13204 panic!(
13205 "buffer is too small (need {} bytes, but got {})",
13206 Self::ENCODED_LEN,
13207 __tmp.remaining(),
13208 )
13209 }
13210 __tmp.put_u64_le(self.time_usec);
13211 __tmp.put_i32_le(self.lat);
13212 __tmp.put_i32_le(self.lon);
13213 __tmp.put_i32_le(self.alt);
13214 __tmp.put_u32_le(self.dgps_age);
13215 __tmp.put_u16_le(self.eph);
13216 __tmp.put_u16_le(self.epv);
13217 __tmp.put_u16_le(self.vel);
13218 __tmp.put_u16_le(self.cog);
13219 __tmp.put_u8(self.fix_type as u8);
13220 __tmp.put_u8(self.satellites_visible);
13221 __tmp.put_u8(self.dgps_numch);
13222 __tmp.put_u16_le(self.yaw);
13223 __tmp.put_i32_le(self.alt_ellipsoid);
13224 __tmp.put_u32_le(self.h_acc);
13225 __tmp.put_u32_le(self.v_acc);
13226 __tmp.put_u32_le(self.vel_acc);
13227 __tmp.put_u32_le(self.hdg_acc);
13228 if matches!(version, MavlinkVersion::V2) {
13229 let len = __tmp.len();
13230 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13231 } else {
13232 __tmp.len()
13233 }
13234 }
13235}
13236#[doc = "id: 128"]
13237#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13238#[derive(Debug, Clone, PartialEq)]
13239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13241pub struct GPS2_RTK_DATA {
13242 #[doc = "Time since boot of last baseline message received."]
13243 pub time_last_baseline_ms: u32,
13244 #[doc = "GPS Time of Week of last baseline"]
13245 pub tow: u32,
13246 #[doc = "Current baseline in ECEF x or NED north component."]
13247 pub baseline_a_mm: i32,
13248 #[doc = "Current baseline in ECEF y or NED east component."]
13249 pub baseline_b_mm: i32,
13250 #[doc = "Current baseline in ECEF z or NED down component."]
13251 pub baseline_c_mm: i32,
13252 #[doc = "Current estimate of baseline accuracy."]
13253 pub accuracy: u32,
13254 #[doc = "Current number of integer ambiguity hypotheses."]
13255 pub iar_num_hypotheses: i32,
13256 #[doc = "GPS Week Number of last baseline"]
13257 pub wn: u16,
13258 #[doc = "Identification of connected RTK receiver."]
13259 pub rtk_receiver_id: u8,
13260 #[doc = "GPS-specific health report for RTK data."]
13261 pub rtk_health: u8,
13262 #[doc = "Rate of baseline messages being received by GPS"]
13263 pub rtk_rate: u8,
13264 #[doc = "Current number of sats used for RTK calculation."]
13265 pub nsats: u8,
13266 #[doc = "Coordinate system of baseline"]
13267 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13268}
13269impl GPS2_RTK_DATA {
13270 pub const ENCODED_LEN: usize = 35usize;
13271 pub const DEFAULT: Self = Self {
13272 time_last_baseline_ms: 0_u32,
13273 tow: 0_u32,
13274 baseline_a_mm: 0_i32,
13275 baseline_b_mm: 0_i32,
13276 baseline_c_mm: 0_i32,
13277 accuracy: 0_u32,
13278 iar_num_hypotheses: 0_i32,
13279 wn: 0_u16,
13280 rtk_receiver_id: 0_u8,
13281 rtk_health: 0_u8,
13282 rtk_rate: 0_u8,
13283 nsats: 0_u8,
13284 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13285 };
13286 #[cfg(feature = "arbitrary")]
13287 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13288 use arbitrary::{Arbitrary, Unstructured};
13289 let mut buf = [0u8; 1024];
13290 rng.fill_bytes(&mut buf);
13291 let mut unstructured = Unstructured::new(&buf);
13292 Self::arbitrary(&mut unstructured).unwrap_or_default()
13293 }
13294}
13295impl Default for GPS2_RTK_DATA {
13296 fn default() -> Self {
13297 Self::DEFAULT.clone()
13298 }
13299}
13300impl MessageData for GPS2_RTK_DATA {
13301 type Message = MavMessage;
13302 const ID: u32 = 128u32;
13303 const NAME: &'static str = "GPS2_RTK";
13304 const EXTRA_CRC: u8 = 226u8;
13305 const ENCODED_LEN: usize = 35usize;
13306 fn deser(
13307 _version: MavlinkVersion,
13308 __input: &[u8],
13309 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13310 let avail_len = __input.len();
13311 let mut payload_buf = [0; Self::ENCODED_LEN];
13312 let mut buf = if avail_len < Self::ENCODED_LEN {
13313 payload_buf[0..avail_len].copy_from_slice(__input);
13314 Bytes::new(&payload_buf)
13315 } else {
13316 Bytes::new(__input)
13317 };
13318 let mut __struct = Self::default();
13319 __struct.time_last_baseline_ms = buf.get_u32_le();
13320 __struct.tow = buf.get_u32_le();
13321 __struct.baseline_a_mm = buf.get_i32_le();
13322 __struct.baseline_b_mm = buf.get_i32_le();
13323 __struct.baseline_c_mm = buf.get_i32_le();
13324 __struct.accuracy = buf.get_u32_le();
13325 __struct.iar_num_hypotheses = buf.get_i32_le();
13326 __struct.wn = buf.get_u16_le();
13327 __struct.rtk_receiver_id = buf.get_u8();
13328 __struct.rtk_health = buf.get_u8();
13329 __struct.rtk_rate = buf.get_u8();
13330 __struct.nsats = buf.get_u8();
13331 let tmp = buf.get_u8();
13332 __struct.baseline_coords_type =
13333 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13334 enum_type: "RtkBaselineCoordinateSystem",
13335 value: tmp as u32,
13336 })?;
13337 Ok(__struct)
13338 }
13339 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13340 let mut __tmp = BytesMut::new(bytes);
13341 #[allow(clippy::absurd_extreme_comparisons)]
13342 #[allow(unused_comparisons)]
13343 if __tmp.remaining() < Self::ENCODED_LEN {
13344 panic!(
13345 "buffer is too small (need {} bytes, but got {})",
13346 Self::ENCODED_LEN,
13347 __tmp.remaining(),
13348 )
13349 }
13350 __tmp.put_u32_le(self.time_last_baseline_ms);
13351 __tmp.put_u32_le(self.tow);
13352 __tmp.put_i32_le(self.baseline_a_mm);
13353 __tmp.put_i32_le(self.baseline_b_mm);
13354 __tmp.put_i32_le(self.baseline_c_mm);
13355 __tmp.put_u32_le(self.accuracy);
13356 __tmp.put_i32_le(self.iar_num_hypotheses);
13357 __tmp.put_u16_le(self.wn);
13358 __tmp.put_u8(self.rtk_receiver_id);
13359 __tmp.put_u8(self.rtk_health);
13360 __tmp.put_u8(self.rtk_rate);
13361 __tmp.put_u8(self.nsats);
13362 __tmp.put_u8(self.baseline_coords_type as u8);
13363 if matches!(version, MavlinkVersion::V2) {
13364 let len = __tmp.len();
13365 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13366 } else {
13367 __tmp.len()
13368 }
13369 }
13370}
13371#[doc = "id: 49"]
13372#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13373#[derive(Debug, Clone, PartialEq)]
13374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13376pub struct GPS_GLOBAL_ORIGIN_DATA {
13377 #[doc = "Latitude (WGS84)"]
13378 pub latitude: i32,
13379 #[doc = "Longitude (WGS84)"]
13380 pub longitude: i32,
13381 #[doc = "Altitude (MSL). Positive for up."]
13382 pub altitude: i32,
13383 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13384 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13385 pub time_usec: u64,
13386}
13387impl GPS_GLOBAL_ORIGIN_DATA {
13388 pub const ENCODED_LEN: usize = 20usize;
13389 pub const DEFAULT: Self = Self {
13390 latitude: 0_i32,
13391 longitude: 0_i32,
13392 altitude: 0_i32,
13393 time_usec: 0_u64,
13394 };
13395 #[cfg(feature = "arbitrary")]
13396 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13397 use arbitrary::{Arbitrary, Unstructured};
13398 let mut buf = [0u8; 1024];
13399 rng.fill_bytes(&mut buf);
13400 let mut unstructured = Unstructured::new(&buf);
13401 Self::arbitrary(&mut unstructured).unwrap_or_default()
13402 }
13403}
13404impl Default for GPS_GLOBAL_ORIGIN_DATA {
13405 fn default() -> Self {
13406 Self::DEFAULT.clone()
13407 }
13408}
13409impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
13410 type Message = MavMessage;
13411 const ID: u32 = 49u32;
13412 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
13413 const EXTRA_CRC: u8 = 39u8;
13414 const ENCODED_LEN: usize = 20usize;
13415 fn deser(
13416 _version: MavlinkVersion,
13417 __input: &[u8],
13418 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13419 let avail_len = __input.len();
13420 let mut payload_buf = [0; Self::ENCODED_LEN];
13421 let mut buf = if avail_len < Self::ENCODED_LEN {
13422 payload_buf[0..avail_len].copy_from_slice(__input);
13423 Bytes::new(&payload_buf)
13424 } else {
13425 Bytes::new(__input)
13426 };
13427 let mut __struct = Self::default();
13428 __struct.latitude = buf.get_i32_le();
13429 __struct.longitude = buf.get_i32_le();
13430 __struct.altitude = buf.get_i32_le();
13431 __struct.time_usec = buf.get_u64_le();
13432 Ok(__struct)
13433 }
13434 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13435 let mut __tmp = BytesMut::new(bytes);
13436 #[allow(clippy::absurd_extreme_comparisons)]
13437 #[allow(unused_comparisons)]
13438 if __tmp.remaining() < Self::ENCODED_LEN {
13439 panic!(
13440 "buffer is too small (need {} bytes, but got {})",
13441 Self::ENCODED_LEN,
13442 __tmp.remaining(),
13443 )
13444 }
13445 __tmp.put_i32_le(self.latitude);
13446 __tmp.put_i32_le(self.longitude);
13447 __tmp.put_i32_le(self.altitude);
13448 __tmp.put_u64_le(self.time_usec);
13449 if matches!(version, MavlinkVersion::V2) {
13450 let len = __tmp.len();
13451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13452 } else {
13453 __tmp.len()
13454 }
13455 }
13456}
13457#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
13458#[doc = "id: 123"]
13459#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
13460#[derive(Debug, Clone, PartialEq)]
13461#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13463pub struct GPS_INJECT_DATA_DATA {
13464 #[doc = "System ID"]
13465 pub target_system: u8,
13466 #[doc = "Component ID"]
13467 pub target_component: u8,
13468 #[doc = "Data length"]
13469 pub len: u8,
13470 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
13471 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13472 pub data: [u8; 110],
13473}
13474impl GPS_INJECT_DATA_DATA {
13475 pub const ENCODED_LEN: usize = 113usize;
13476 pub const DEFAULT: Self = Self {
13477 target_system: 0_u8,
13478 target_component: 0_u8,
13479 len: 0_u8,
13480 data: [0_u8; 110usize],
13481 };
13482 #[cfg(feature = "arbitrary")]
13483 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13484 use arbitrary::{Arbitrary, Unstructured};
13485 let mut buf = [0u8; 1024];
13486 rng.fill_bytes(&mut buf);
13487 let mut unstructured = Unstructured::new(&buf);
13488 Self::arbitrary(&mut unstructured).unwrap_or_default()
13489 }
13490}
13491impl Default for GPS_INJECT_DATA_DATA {
13492 fn default() -> Self {
13493 Self::DEFAULT.clone()
13494 }
13495}
13496impl MessageData for GPS_INJECT_DATA_DATA {
13497 type Message = MavMessage;
13498 const ID: u32 = 123u32;
13499 const NAME: &'static str = "GPS_INJECT_DATA";
13500 const EXTRA_CRC: u8 = 250u8;
13501 const ENCODED_LEN: usize = 113usize;
13502 fn deser(
13503 _version: MavlinkVersion,
13504 __input: &[u8],
13505 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13506 let avail_len = __input.len();
13507 let mut payload_buf = [0; Self::ENCODED_LEN];
13508 let mut buf = if avail_len < Self::ENCODED_LEN {
13509 payload_buf[0..avail_len].copy_from_slice(__input);
13510 Bytes::new(&payload_buf)
13511 } else {
13512 Bytes::new(__input)
13513 };
13514 let mut __struct = Self::default();
13515 __struct.target_system = buf.get_u8();
13516 __struct.target_component = buf.get_u8();
13517 __struct.len = buf.get_u8();
13518 for v in &mut __struct.data {
13519 let val = buf.get_u8();
13520 *v = val;
13521 }
13522 Ok(__struct)
13523 }
13524 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13525 let mut __tmp = BytesMut::new(bytes);
13526 #[allow(clippy::absurd_extreme_comparisons)]
13527 #[allow(unused_comparisons)]
13528 if __tmp.remaining() < Self::ENCODED_LEN {
13529 panic!(
13530 "buffer is too small (need {} bytes, but got {})",
13531 Self::ENCODED_LEN,
13532 __tmp.remaining(),
13533 )
13534 }
13535 __tmp.put_u8(self.target_system);
13536 __tmp.put_u8(self.target_component);
13537 __tmp.put_u8(self.len);
13538 for val in &self.data {
13539 __tmp.put_u8(*val);
13540 }
13541 if matches!(version, MavlinkVersion::V2) {
13542 let len = __tmp.len();
13543 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13544 } else {
13545 __tmp.len()
13546 }
13547 }
13548}
13549#[doc = "id: 232"]
13550#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
13551#[derive(Debug, Clone, PartialEq)]
13552#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13553#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13554pub struct GPS_INPUT_DATA {
13555 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13556 pub time_usec: u64,
13557 #[doc = "GPS time (from start of GPS week)"]
13558 pub time_week_ms: u32,
13559 #[doc = "Latitude (WGS84)"]
13560 pub lat: i32,
13561 #[doc = "Longitude (WGS84)"]
13562 pub lon: i32,
13563 #[doc = "Altitude (MSL). Positive for up."]
13564 pub alt: f32,
13565 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13566 pub hdop: f32,
13567 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13568 pub vdop: f32,
13569 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
13570 pub vn: f32,
13571 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
13572 pub ve: f32,
13573 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
13574 pub vd: f32,
13575 #[doc = "GPS speed accuracy"]
13576 pub speed_accuracy: f32,
13577 #[doc = "GPS horizontal accuracy"]
13578 pub horiz_accuracy: f32,
13579 #[doc = "GPS vertical accuracy"]
13580 pub vert_accuracy: f32,
13581 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
13582 pub ignore_flags: GpsInputIgnoreFlags,
13583 #[doc = "GPS week number"]
13584 pub time_week: u16,
13585 #[doc = "ID of the GPS for multiple GPS inputs"]
13586 pub gps_id: u8,
13587 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
13588 pub fix_type: u8,
13589 #[doc = "Number of satellites visible."]
13590 pub satellites_visible: u8,
13591 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
13592 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13593 pub yaw: u16,
13594}
13595impl GPS_INPUT_DATA {
13596 pub const ENCODED_LEN: usize = 65usize;
13597 pub const DEFAULT: Self = Self {
13598 time_usec: 0_u64,
13599 time_week_ms: 0_u32,
13600 lat: 0_i32,
13601 lon: 0_i32,
13602 alt: 0.0_f32,
13603 hdop: 0.0_f32,
13604 vdop: 0.0_f32,
13605 vn: 0.0_f32,
13606 ve: 0.0_f32,
13607 vd: 0.0_f32,
13608 speed_accuracy: 0.0_f32,
13609 horiz_accuracy: 0.0_f32,
13610 vert_accuracy: 0.0_f32,
13611 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
13612 time_week: 0_u16,
13613 gps_id: 0_u8,
13614 fix_type: 0_u8,
13615 satellites_visible: 0_u8,
13616 yaw: 0_u16,
13617 };
13618 #[cfg(feature = "arbitrary")]
13619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13620 use arbitrary::{Arbitrary, Unstructured};
13621 let mut buf = [0u8; 1024];
13622 rng.fill_bytes(&mut buf);
13623 let mut unstructured = Unstructured::new(&buf);
13624 Self::arbitrary(&mut unstructured).unwrap_or_default()
13625 }
13626}
13627impl Default for GPS_INPUT_DATA {
13628 fn default() -> Self {
13629 Self::DEFAULT.clone()
13630 }
13631}
13632impl MessageData for GPS_INPUT_DATA {
13633 type Message = MavMessage;
13634 const ID: u32 = 232u32;
13635 const NAME: &'static str = "GPS_INPUT";
13636 const EXTRA_CRC: u8 = 151u8;
13637 const ENCODED_LEN: usize = 65usize;
13638 fn deser(
13639 _version: MavlinkVersion,
13640 __input: &[u8],
13641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13642 let avail_len = __input.len();
13643 let mut payload_buf = [0; Self::ENCODED_LEN];
13644 let mut buf = if avail_len < Self::ENCODED_LEN {
13645 payload_buf[0..avail_len].copy_from_slice(__input);
13646 Bytes::new(&payload_buf)
13647 } else {
13648 Bytes::new(__input)
13649 };
13650 let mut __struct = Self::default();
13651 __struct.time_usec = buf.get_u64_le();
13652 __struct.time_week_ms = buf.get_u32_le();
13653 __struct.lat = buf.get_i32_le();
13654 __struct.lon = buf.get_i32_le();
13655 __struct.alt = buf.get_f32_le();
13656 __struct.hdop = buf.get_f32_le();
13657 __struct.vdop = buf.get_f32_le();
13658 __struct.vn = buf.get_f32_le();
13659 __struct.ve = buf.get_f32_le();
13660 __struct.vd = buf.get_f32_le();
13661 __struct.speed_accuracy = buf.get_f32_le();
13662 __struct.horiz_accuracy = buf.get_f32_le();
13663 __struct.vert_accuracy = buf.get_f32_le();
13664 let tmp = buf.get_u16_le();
13665 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
13666 tmp & GpsInputIgnoreFlags::all().bits(),
13667 )
13668 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13669 flag_type: "GpsInputIgnoreFlags",
13670 value: tmp as u32,
13671 })?;
13672 __struct.time_week = buf.get_u16_le();
13673 __struct.gps_id = buf.get_u8();
13674 __struct.fix_type = buf.get_u8();
13675 __struct.satellites_visible = buf.get_u8();
13676 __struct.yaw = buf.get_u16_le();
13677 Ok(__struct)
13678 }
13679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13680 let mut __tmp = BytesMut::new(bytes);
13681 #[allow(clippy::absurd_extreme_comparisons)]
13682 #[allow(unused_comparisons)]
13683 if __tmp.remaining() < Self::ENCODED_LEN {
13684 panic!(
13685 "buffer is too small (need {} bytes, but got {})",
13686 Self::ENCODED_LEN,
13687 __tmp.remaining(),
13688 )
13689 }
13690 __tmp.put_u64_le(self.time_usec);
13691 __tmp.put_u32_le(self.time_week_ms);
13692 __tmp.put_i32_le(self.lat);
13693 __tmp.put_i32_le(self.lon);
13694 __tmp.put_f32_le(self.alt);
13695 __tmp.put_f32_le(self.hdop);
13696 __tmp.put_f32_le(self.vdop);
13697 __tmp.put_f32_le(self.vn);
13698 __tmp.put_f32_le(self.ve);
13699 __tmp.put_f32_le(self.vd);
13700 __tmp.put_f32_le(self.speed_accuracy);
13701 __tmp.put_f32_le(self.horiz_accuracy);
13702 __tmp.put_f32_le(self.vert_accuracy);
13703 __tmp.put_u16_le(self.ignore_flags.bits());
13704 __tmp.put_u16_le(self.time_week);
13705 __tmp.put_u8(self.gps_id);
13706 __tmp.put_u8(self.fix_type);
13707 __tmp.put_u8(self.satellites_visible);
13708 __tmp.put_u16_le(self.yaw);
13709 if matches!(version, MavlinkVersion::V2) {
13710 let len = __tmp.len();
13711 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13712 } else {
13713 __tmp.len()
13714 }
13715 }
13716}
13717#[doc = "id: 24"]
13718#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
13719#[derive(Debug, Clone, PartialEq)]
13720#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13721#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13722pub struct GPS_RAW_INT_DATA {
13723 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13724 pub time_usec: u64,
13725 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
13726 pub lat: i32,
13727 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
13728 pub lon: i32,
13729 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
13730 pub alt: i32,
13731 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13732 pub eph: u16,
13733 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13734 pub epv: u16,
13735 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13736 pub vel: u16,
13737 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13738 pub cog: u16,
13739 #[doc = "GPS fix type."]
13740 pub fix_type: GpsFixType,
13741 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13742 pub satellites_visible: u8,
13743 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13744 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13745 pub alt_ellipsoid: i32,
13746 #[doc = "Position uncertainty."]
13747 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13748 pub h_acc: u32,
13749 #[doc = "Altitude uncertainty."]
13750 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13751 pub v_acc: u32,
13752 #[doc = "Speed uncertainty."]
13753 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13754 pub vel_acc: u32,
13755 #[doc = "Heading / track uncertainty"]
13756 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13757 pub hdg_acc: u32,
13758 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13759 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13760 pub yaw: u16,
13761}
13762impl GPS_RAW_INT_DATA {
13763 pub const ENCODED_LEN: usize = 52usize;
13764 pub const DEFAULT: Self = Self {
13765 time_usec: 0_u64,
13766 lat: 0_i32,
13767 lon: 0_i32,
13768 alt: 0_i32,
13769 eph: 0_u16,
13770 epv: 0_u16,
13771 vel: 0_u16,
13772 cog: 0_u16,
13773 fix_type: GpsFixType::DEFAULT,
13774 satellites_visible: 0_u8,
13775 alt_ellipsoid: 0_i32,
13776 h_acc: 0_u32,
13777 v_acc: 0_u32,
13778 vel_acc: 0_u32,
13779 hdg_acc: 0_u32,
13780 yaw: 0_u16,
13781 };
13782 #[cfg(feature = "arbitrary")]
13783 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13784 use arbitrary::{Arbitrary, Unstructured};
13785 let mut buf = [0u8; 1024];
13786 rng.fill_bytes(&mut buf);
13787 let mut unstructured = Unstructured::new(&buf);
13788 Self::arbitrary(&mut unstructured).unwrap_or_default()
13789 }
13790}
13791impl Default for GPS_RAW_INT_DATA {
13792 fn default() -> Self {
13793 Self::DEFAULT.clone()
13794 }
13795}
13796impl MessageData for GPS_RAW_INT_DATA {
13797 type Message = MavMessage;
13798 const ID: u32 = 24u32;
13799 const NAME: &'static str = "GPS_RAW_INT";
13800 const EXTRA_CRC: u8 = 24u8;
13801 const ENCODED_LEN: usize = 52usize;
13802 fn deser(
13803 _version: MavlinkVersion,
13804 __input: &[u8],
13805 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13806 let avail_len = __input.len();
13807 let mut payload_buf = [0; Self::ENCODED_LEN];
13808 let mut buf = if avail_len < Self::ENCODED_LEN {
13809 payload_buf[0..avail_len].copy_from_slice(__input);
13810 Bytes::new(&payload_buf)
13811 } else {
13812 Bytes::new(__input)
13813 };
13814 let mut __struct = Self::default();
13815 __struct.time_usec = buf.get_u64_le();
13816 __struct.lat = buf.get_i32_le();
13817 __struct.lon = buf.get_i32_le();
13818 __struct.alt = buf.get_i32_le();
13819 __struct.eph = buf.get_u16_le();
13820 __struct.epv = buf.get_u16_le();
13821 __struct.vel = buf.get_u16_le();
13822 __struct.cog = buf.get_u16_le();
13823 let tmp = buf.get_u8();
13824 __struct.fix_type =
13825 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13826 enum_type: "GpsFixType",
13827 value: tmp as u32,
13828 })?;
13829 __struct.satellites_visible = buf.get_u8();
13830 __struct.alt_ellipsoid = buf.get_i32_le();
13831 __struct.h_acc = buf.get_u32_le();
13832 __struct.v_acc = buf.get_u32_le();
13833 __struct.vel_acc = buf.get_u32_le();
13834 __struct.hdg_acc = buf.get_u32_le();
13835 __struct.yaw = buf.get_u16_le();
13836 Ok(__struct)
13837 }
13838 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13839 let mut __tmp = BytesMut::new(bytes);
13840 #[allow(clippy::absurd_extreme_comparisons)]
13841 #[allow(unused_comparisons)]
13842 if __tmp.remaining() < Self::ENCODED_LEN {
13843 panic!(
13844 "buffer is too small (need {} bytes, but got {})",
13845 Self::ENCODED_LEN,
13846 __tmp.remaining(),
13847 )
13848 }
13849 __tmp.put_u64_le(self.time_usec);
13850 __tmp.put_i32_le(self.lat);
13851 __tmp.put_i32_le(self.lon);
13852 __tmp.put_i32_le(self.alt);
13853 __tmp.put_u16_le(self.eph);
13854 __tmp.put_u16_le(self.epv);
13855 __tmp.put_u16_le(self.vel);
13856 __tmp.put_u16_le(self.cog);
13857 __tmp.put_u8(self.fix_type as u8);
13858 __tmp.put_u8(self.satellites_visible);
13859 __tmp.put_i32_le(self.alt_ellipsoid);
13860 __tmp.put_u32_le(self.h_acc);
13861 __tmp.put_u32_le(self.v_acc);
13862 __tmp.put_u32_le(self.vel_acc);
13863 __tmp.put_u32_le(self.hdg_acc);
13864 __tmp.put_u16_le(self.yaw);
13865 if matches!(version, MavlinkVersion::V2) {
13866 let len = __tmp.len();
13867 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13868 } else {
13869 __tmp.len()
13870 }
13871 }
13872}
13873#[doc = "id: 233"]
13874#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
13875#[derive(Debug, Clone, PartialEq)]
13876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13878pub struct GPS_RTCM_DATA_DATA {
13879 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
13880 pub flags: u8,
13881 #[doc = "data length"]
13882 pub len: u8,
13883 #[doc = "RTCM message (may be fragmented)"]
13884 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13885 pub data: [u8; 180],
13886}
13887impl GPS_RTCM_DATA_DATA {
13888 pub const ENCODED_LEN: usize = 182usize;
13889 pub const DEFAULT: Self = Self {
13890 flags: 0_u8,
13891 len: 0_u8,
13892 data: [0_u8; 180usize],
13893 };
13894 #[cfg(feature = "arbitrary")]
13895 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13896 use arbitrary::{Arbitrary, Unstructured};
13897 let mut buf = [0u8; 1024];
13898 rng.fill_bytes(&mut buf);
13899 let mut unstructured = Unstructured::new(&buf);
13900 Self::arbitrary(&mut unstructured).unwrap_or_default()
13901 }
13902}
13903impl Default for GPS_RTCM_DATA_DATA {
13904 fn default() -> Self {
13905 Self::DEFAULT.clone()
13906 }
13907}
13908impl MessageData for GPS_RTCM_DATA_DATA {
13909 type Message = MavMessage;
13910 const ID: u32 = 233u32;
13911 const NAME: &'static str = "GPS_RTCM_DATA";
13912 const EXTRA_CRC: u8 = 35u8;
13913 const ENCODED_LEN: usize = 182usize;
13914 fn deser(
13915 _version: MavlinkVersion,
13916 __input: &[u8],
13917 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13918 let avail_len = __input.len();
13919 let mut payload_buf = [0; Self::ENCODED_LEN];
13920 let mut buf = if avail_len < Self::ENCODED_LEN {
13921 payload_buf[0..avail_len].copy_from_slice(__input);
13922 Bytes::new(&payload_buf)
13923 } else {
13924 Bytes::new(__input)
13925 };
13926 let mut __struct = Self::default();
13927 __struct.flags = buf.get_u8();
13928 __struct.len = buf.get_u8();
13929 for v in &mut __struct.data {
13930 let val = buf.get_u8();
13931 *v = val;
13932 }
13933 Ok(__struct)
13934 }
13935 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13936 let mut __tmp = BytesMut::new(bytes);
13937 #[allow(clippy::absurd_extreme_comparisons)]
13938 #[allow(unused_comparisons)]
13939 if __tmp.remaining() < Self::ENCODED_LEN {
13940 panic!(
13941 "buffer is too small (need {} bytes, but got {})",
13942 Self::ENCODED_LEN,
13943 __tmp.remaining(),
13944 )
13945 }
13946 __tmp.put_u8(self.flags);
13947 __tmp.put_u8(self.len);
13948 for val in &self.data {
13949 __tmp.put_u8(*val);
13950 }
13951 if matches!(version, MavlinkVersion::V2) {
13952 let len = __tmp.len();
13953 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13954 } else {
13955 __tmp.len()
13956 }
13957 }
13958}
13959#[doc = "id: 127"]
13960#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13961#[derive(Debug, Clone, PartialEq)]
13962#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13964pub struct GPS_RTK_DATA {
13965 #[doc = "Time since boot of last baseline message received."]
13966 pub time_last_baseline_ms: u32,
13967 #[doc = "GPS Time of Week of last baseline"]
13968 pub tow: u32,
13969 #[doc = "Current baseline in ECEF x or NED north component."]
13970 pub baseline_a_mm: i32,
13971 #[doc = "Current baseline in ECEF y or NED east component."]
13972 pub baseline_b_mm: i32,
13973 #[doc = "Current baseline in ECEF z or NED down component."]
13974 pub baseline_c_mm: i32,
13975 #[doc = "Current estimate of baseline accuracy."]
13976 pub accuracy: u32,
13977 #[doc = "Current number of integer ambiguity hypotheses."]
13978 pub iar_num_hypotheses: i32,
13979 #[doc = "GPS Week Number of last baseline"]
13980 pub wn: u16,
13981 #[doc = "Identification of connected RTK receiver."]
13982 pub rtk_receiver_id: u8,
13983 #[doc = "GPS-specific health report for RTK data."]
13984 pub rtk_health: u8,
13985 #[doc = "Rate of baseline messages being received by GPS"]
13986 pub rtk_rate: u8,
13987 #[doc = "Current number of sats used for RTK calculation."]
13988 pub nsats: u8,
13989 #[doc = "Coordinate system of baseline"]
13990 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13991}
13992impl GPS_RTK_DATA {
13993 pub const ENCODED_LEN: usize = 35usize;
13994 pub const DEFAULT: Self = Self {
13995 time_last_baseline_ms: 0_u32,
13996 tow: 0_u32,
13997 baseline_a_mm: 0_i32,
13998 baseline_b_mm: 0_i32,
13999 baseline_c_mm: 0_i32,
14000 accuracy: 0_u32,
14001 iar_num_hypotheses: 0_i32,
14002 wn: 0_u16,
14003 rtk_receiver_id: 0_u8,
14004 rtk_health: 0_u8,
14005 rtk_rate: 0_u8,
14006 nsats: 0_u8,
14007 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14008 };
14009 #[cfg(feature = "arbitrary")]
14010 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14011 use arbitrary::{Arbitrary, Unstructured};
14012 let mut buf = [0u8; 1024];
14013 rng.fill_bytes(&mut buf);
14014 let mut unstructured = Unstructured::new(&buf);
14015 Self::arbitrary(&mut unstructured).unwrap_or_default()
14016 }
14017}
14018impl Default for GPS_RTK_DATA {
14019 fn default() -> Self {
14020 Self::DEFAULT.clone()
14021 }
14022}
14023impl MessageData for GPS_RTK_DATA {
14024 type Message = MavMessage;
14025 const ID: u32 = 127u32;
14026 const NAME: &'static str = "GPS_RTK";
14027 const EXTRA_CRC: u8 = 25u8;
14028 const ENCODED_LEN: usize = 35usize;
14029 fn deser(
14030 _version: MavlinkVersion,
14031 __input: &[u8],
14032 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14033 let avail_len = __input.len();
14034 let mut payload_buf = [0; Self::ENCODED_LEN];
14035 let mut buf = if avail_len < Self::ENCODED_LEN {
14036 payload_buf[0..avail_len].copy_from_slice(__input);
14037 Bytes::new(&payload_buf)
14038 } else {
14039 Bytes::new(__input)
14040 };
14041 let mut __struct = Self::default();
14042 __struct.time_last_baseline_ms = buf.get_u32_le();
14043 __struct.tow = buf.get_u32_le();
14044 __struct.baseline_a_mm = buf.get_i32_le();
14045 __struct.baseline_b_mm = buf.get_i32_le();
14046 __struct.baseline_c_mm = buf.get_i32_le();
14047 __struct.accuracy = buf.get_u32_le();
14048 __struct.iar_num_hypotheses = buf.get_i32_le();
14049 __struct.wn = buf.get_u16_le();
14050 __struct.rtk_receiver_id = buf.get_u8();
14051 __struct.rtk_health = buf.get_u8();
14052 __struct.rtk_rate = buf.get_u8();
14053 __struct.nsats = buf.get_u8();
14054 let tmp = buf.get_u8();
14055 __struct.baseline_coords_type =
14056 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14057 enum_type: "RtkBaselineCoordinateSystem",
14058 value: tmp as u32,
14059 })?;
14060 Ok(__struct)
14061 }
14062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14063 let mut __tmp = BytesMut::new(bytes);
14064 #[allow(clippy::absurd_extreme_comparisons)]
14065 #[allow(unused_comparisons)]
14066 if __tmp.remaining() < Self::ENCODED_LEN {
14067 panic!(
14068 "buffer is too small (need {} bytes, but got {})",
14069 Self::ENCODED_LEN,
14070 __tmp.remaining(),
14071 )
14072 }
14073 __tmp.put_u32_le(self.time_last_baseline_ms);
14074 __tmp.put_u32_le(self.tow);
14075 __tmp.put_i32_le(self.baseline_a_mm);
14076 __tmp.put_i32_le(self.baseline_b_mm);
14077 __tmp.put_i32_le(self.baseline_c_mm);
14078 __tmp.put_u32_le(self.accuracy);
14079 __tmp.put_i32_le(self.iar_num_hypotheses);
14080 __tmp.put_u16_le(self.wn);
14081 __tmp.put_u8(self.rtk_receiver_id);
14082 __tmp.put_u8(self.rtk_health);
14083 __tmp.put_u8(self.rtk_rate);
14084 __tmp.put_u8(self.nsats);
14085 __tmp.put_u8(self.baseline_coords_type as u8);
14086 if matches!(version, MavlinkVersion::V2) {
14087 let len = __tmp.len();
14088 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14089 } else {
14090 __tmp.len()
14091 }
14092 }
14093}
14094#[doc = "id: 25"]
14095#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14096#[derive(Debug, Clone, PartialEq)]
14097#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14099pub struct GPS_STATUS_DATA {
14100 #[doc = "Number of satellites visible"]
14101 pub satellites_visible: u8,
14102 #[doc = "Global satellite ID"]
14103 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14104 pub satellite_prn: [u8; 20],
14105 #[doc = "0: Satellite not used, 1: used for localization"]
14106 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14107 pub satellite_used: [u8; 20],
14108 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14109 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14110 pub satellite_elevation: [u8; 20],
14111 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14112 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14113 pub satellite_azimuth: [u8; 20],
14114 #[doc = "Signal to noise ratio of satellite"]
14115 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14116 pub satellite_snr: [u8; 20],
14117}
14118impl GPS_STATUS_DATA {
14119 pub const ENCODED_LEN: usize = 101usize;
14120 pub const DEFAULT: Self = Self {
14121 satellites_visible: 0_u8,
14122 satellite_prn: [0_u8; 20usize],
14123 satellite_used: [0_u8; 20usize],
14124 satellite_elevation: [0_u8; 20usize],
14125 satellite_azimuth: [0_u8; 20usize],
14126 satellite_snr: [0_u8; 20usize],
14127 };
14128 #[cfg(feature = "arbitrary")]
14129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14130 use arbitrary::{Arbitrary, Unstructured};
14131 let mut buf = [0u8; 1024];
14132 rng.fill_bytes(&mut buf);
14133 let mut unstructured = Unstructured::new(&buf);
14134 Self::arbitrary(&mut unstructured).unwrap_or_default()
14135 }
14136}
14137impl Default for GPS_STATUS_DATA {
14138 fn default() -> Self {
14139 Self::DEFAULT.clone()
14140 }
14141}
14142impl MessageData for GPS_STATUS_DATA {
14143 type Message = MavMessage;
14144 const ID: u32 = 25u32;
14145 const NAME: &'static str = "GPS_STATUS";
14146 const EXTRA_CRC: u8 = 23u8;
14147 const ENCODED_LEN: usize = 101usize;
14148 fn deser(
14149 _version: MavlinkVersion,
14150 __input: &[u8],
14151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14152 let avail_len = __input.len();
14153 let mut payload_buf = [0; Self::ENCODED_LEN];
14154 let mut buf = if avail_len < Self::ENCODED_LEN {
14155 payload_buf[0..avail_len].copy_from_slice(__input);
14156 Bytes::new(&payload_buf)
14157 } else {
14158 Bytes::new(__input)
14159 };
14160 let mut __struct = Self::default();
14161 __struct.satellites_visible = buf.get_u8();
14162 for v in &mut __struct.satellite_prn {
14163 let val = buf.get_u8();
14164 *v = val;
14165 }
14166 for v in &mut __struct.satellite_used {
14167 let val = buf.get_u8();
14168 *v = val;
14169 }
14170 for v in &mut __struct.satellite_elevation {
14171 let val = buf.get_u8();
14172 *v = val;
14173 }
14174 for v in &mut __struct.satellite_azimuth {
14175 let val = buf.get_u8();
14176 *v = val;
14177 }
14178 for v in &mut __struct.satellite_snr {
14179 let val = buf.get_u8();
14180 *v = val;
14181 }
14182 Ok(__struct)
14183 }
14184 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14185 let mut __tmp = BytesMut::new(bytes);
14186 #[allow(clippy::absurd_extreme_comparisons)]
14187 #[allow(unused_comparisons)]
14188 if __tmp.remaining() < Self::ENCODED_LEN {
14189 panic!(
14190 "buffer is too small (need {} bytes, but got {})",
14191 Self::ENCODED_LEN,
14192 __tmp.remaining(),
14193 )
14194 }
14195 __tmp.put_u8(self.satellites_visible);
14196 for val in &self.satellite_prn {
14197 __tmp.put_u8(*val);
14198 }
14199 for val in &self.satellite_used {
14200 __tmp.put_u8(*val);
14201 }
14202 for val in &self.satellite_elevation {
14203 __tmp.put_u8(*val);
14204 }
14205 for val in &self.satellite_azimuth {
14206 __tmp.put_u8(*val);
14207 }
14208 for val in &self.satellite_snr {
14209 __tmp.put_u8(*val);
14210 }
14211 if matches!(version, MavlinkVersion::V2) {
14212 let len = __tmp.len();
14213 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14214 } else {
14215 __tmp.len()
14216 }
14217 }
14218}
14219#[doc = "id: 0"]
14220#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14221#[derive(Debug, Clone, PartialEq)]
14222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14224pub struct HEARTBEAT_DATA {
14225 #[doc = "A bitfield for use for autopilot-specific flags"]
14226 pub custom_mode: u32,
14227 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14228 pub mavtype: MavType,
14229 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14230 pub autopilot: MavAutopilot,
14231 #[doc = "System mode bitmap."]
14232 pub base_mode: MavModeFlag,
14233 #[doc = "System status flag."]
14234 pub system_status: MavState,
14235 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14236 pub mavlink_version: u8,
14237}
14238impl HEARTBEAT_DATA {
14239 pub const ENCODED_LEN: usize = 9usize;
14240 pub const DEFAULT: Self = Self {
14241 custom_mode: 0_u32,
14242 mavtype: MavType::DEFAULT,
14243 autopilot: MavAutopilot::DEFAULT,
14244 base_mode: MavModeFlag::DEFAULT,
14245 system_status: MavState::DEFAULT,
14246 mavlink_version: 0_u8,
14247 };
14248 #[cfg(feature = "arbitrary")]
14249 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14250 use arbitrary::{Arbitrary, Unstructured};
14251 let mut buf = [0u8; 1024];
14252 rng.fill_bytes(&mut buf);
14253 let mut unstructured = Unstructured::new(&buf);
14254 Self::arbitrary(&mut unstructured).unwrap_or_default()
14255 }
14256}
14257impl Default for HEARTBEAT_DATA {
14258 fn default() -> Self {
14259 Self::DEFAULT.clone()
14260 }
14261}
14262impl MessageData for HEARTBEAT_DATA {
14263 type Message = MavMessage;
14264 const ID: u32 = 0u32;
14265 const NAME: &'static str = "HEARTBEAT";
14266 const EXTRA_CRC: u8 = 50u8;
14267 const ENCODED_LEN: usize = 9usize;
14268 fn deser(
14269 _version: MavlinkVersion,
14270 __input: &[u8],
14271 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14272 let avail_len = __input.len();
14273 let mut payload_buf = [0; Self::ENCODED_LEN];
14274 let mut buf = if avail_len < Self::ENCODED_LEN {
14275 payload_buf[0..avail_len].copy_from_slice(__input);
14276 Bytes::new(&payload_buf)
14277 } else {
14278 Bytes::new(__input)
14279 };
14280 let mut __struct = Self::default();
14281 __struct.custom_mode = buf.get_u32_le();
14282 let tmp = buf.get_u8();
14283 __struct.mavtype =
14284 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14285 enum_type: "MavType",
14286 value: tmp as u32,
14287 })?;
14288 let tmp = buf.get_u8();
14289 __struct.autopilot =
14290 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14291 enum_type: "MavAutopilot",
14292 value: tmp as u32,
14293 })?;
14294 let tmp = buf.get_u8();
14295 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14296 ::mavlink_core::error::ParserError::InvalidFlag {
14297 flag_type: "MavModeFlag",
14298 value: tmp as u32,
14299 },
14300 )?;
14301 let tmp = buf.get_u8();
14302 __struct.system_status =
14303 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14304 enum_type: "MavState",
14305 value: tmp as u32,
14306 })?;
14307 __struct.mavlink_version = buf.get_u8();
14308 Ok(__struct)
14309 }
14310 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14311 let mut __tmp = BytesMut::new(bytes);
14312 #[allow(clippy::absurd_extreme_comparisons)]
14313 #[allow(unused_comparisons)]
14314 if __tmp.remaining() < Self::ENCODED_LEN {
14315 panic!(
14316 "buffer is too small (need {} bytes, but got {})",
14317 Self::ENCODED_LEN,
14318 __tmp.remaining(),
14319 )
14320 }
14321 __tmp.put_u32_le(self.custom_mode);
14322 __tmp.put_u8(self.mavtype as u8);
14323 __tmp.put_u8(self.autopilot as u8);
14324 __tmp.put_u8(self.base_mode.bits());
14325 __tmp.put_u8(self.system_status as u8);
14326 __tmp.put_u8(self.mavlink_version);
14327 if matches!(version, MavlinkVersion::V2) {
14328 let len = __tmp.len();
14329 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14330 } else {
14331 __tmp.len()
14332 }
14333 }
14334}
14335#[doc = "id: 105"]
14336#[doc = "The IMU readings in SI units in NED body frame."]
14337#[derive(Debug, Clone, PartialEq)]
14338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14340pub struct HIGHRES_IMU_DATA {
14341 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14342 pub time_usec: u64,
14343 #[doc = "X acceleration"]
14344 pub xacc: f32,
14345 #[doc = "Y acceleration"]
14346 pub yacc: f32,
14347 #[doc = "Z acceleration"]
14348 pub zacc: f32,
14349 #[doc = "Angular speed around X axis"]
14350 pub xgyro: f32,
14351 #[doc = "Angular speed around Y axis"]
14352 pub ygyro: f32,
14353 #[doc = "Angular speed around Z axis"]
14354 pub zgyro: f32,
14355 #[doc = "X Magnetic field"]
14356 pub xmag: f32,
14357 #[doc = "Y Magnetic field"]
14358 pub ymag: f32,
14359 #[doc = "Z Magnetic field"]
14360 pub zmag: f32,
14361 #[doc = "Absolute pressure"]
14362 pub abs_pressure: f32,
14363 #[doc = "Differential pressure"]
14364 pub diff_pressure: f32,
14365 #[doc = "Altitude calculated from pressure"]
14366 pub pressure_alt: f32,
14367 #[doc = "Temperature"]
14368 pub temperature: f32,
14369 #[doc = "Bitmap for fields that have updated since last message"]
14370 pub fields_updated: HighresImuUpdatedFlags,
14371 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
14372 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14373 pub id: u8,
14374}
14375impl HIGHRES_IMU_DATA {
14376 pub const ENCODED_LEN: usize = 63usize;
14377 pub const DEFAULT: Self = Self {
14378 time_usec: 0_u64,
14379 xacc: 0.0_f32,
14380 yacc: 0.0_f32,
14381 zacc: 0.0_f32,
14382 xgyro: 0.0_f32,
14383 ygyro: 0.0_f32,
14384 zgyro: 0.0_f32,
14385 xmag: 0.0_f32,
14386 ymag: 0.0_f32,
14387 zmag: 0.0_f32,
14388 abs_pressure: 0.0_f32,
14389 diff_pressure: 0.0_f32,
14390 pressure_alt: 0.0_f32,
14391 temperature: 0.0_f32,
14392 fields_updated: HighresImuUpdatedFlags::DEFAULT,
14393 id: 0_u8,
14394 };
14395 #[cfg(feature = "arbitrary")]
14396 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14397 use arbitrary::{Arbitrary, Unstructured};
14398 let mut buf = [0u8; 1024];
14399 rng.fill_bytes(&mut buf);
14400 let mut unstructured = Unstructured::new(&buf);
14401 Self::arbitrary(&mut unstructured).unwrap_or_default()
14402 }
14403}
14404impl Default for HIGHRES_IMU_DATA {
14405 fn default() -> Self {
14406 Self::DEFAULT.clone()
14407 }
14408}
14409impl MessageData for HIGHRES_IMU_DATA {
14410 type Message = MavMessage;
14411 const ID: u32 = 105u32;
14412 const NAME: &'static str = "HIGHRES_IMU";
14413 const EXTRA_CRC: u8 = 93u8;
14414 const ENCODED_LEN: usize = 63usize;
14415 fn deser(
14416 _version: MavlinkVersion,
14417 __input: &[u8],
14418 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14419 let avail_len = __input.len();
14420 let mut payload_buf = [0; Self::ENCODED_LEN];
14421 let mut buf = if avail_len < Self::ENCODED_LEN {
14422 payload_buf[0..avail_len].copy_from_slice(__input);
14423 Bytes::new(&payload_buf)
14424 } else {
14425 Bytes::new(__input)
14426 };
14427 let mut __struct = Self::default();
14428 __struct.time_usec = buf.get_u64_le();
14429 __struct.xacc = buf.get_f32_le();
14430 __struct.yacc = buf.get_f32_le();
14431 __struct.zacc = buf.get_f32_le();
14432 __struct.xgyro = buf.get_f32_le();
14433 __struct.ygyro = buf.get_f32_le();
14434 __struct.zgyro = buf.get_f32_le();
14435 __struct.xmag = buf.get_f32_le();
14436 __struct.ymag = buf.get_f32_le();
14437 __struct.zmag = buf.get_f32_le();
14438 __struct.abs_pressure = buf.get_f32_le();
14439 __struct.diff_pressure = buf.get_f32_le();
14440 __struct.pressure_alt = buf.get_f32_le();
14441 __struct.temperature = buf.get_f32_le();
14442 let tmp = buf.get_u16_le();
14443 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
14444 tmp & HighresImuUpdatedFlags::all().bits(),
14445 )
14446 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14447 flag_type: "HighresImuUpdatedFlags",
14448 value: tmp as u32,
14449 })?;
14450 __struct.id = buf.get_u8();
14451 Ok(__struct)
14452 }
14453 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14454 let mut __tmp = BytesMut::new(bytes);
14455 #[allow(clippy::absurd_extreme_comparisons)]
14456 #[allow(unused_comparisons)]
14457 if __tmp.remaining() < Self::ENCODED_LEN {
14458 panic!(
14459 "buffer is too small (need {} bytes, but got {})",
14460 Self::ENCODED_LEN,
14461 __tmp.remaining(),
14462 )
14463 }
14464 __tmp.put_u64_le(self.time_usec);
14465 __tmp.put_f32_le(self.xacc);
14466 __tmp.put_f32_le(self.yacc);
14467 __tmp.put_f32_le(self.zacc);
14468 __tmp.put_f32_le(self.xgyro);
14469 __tmp.put_f32_le(self.ygyro);
14470 __tmp.put_f32_le(self.zgyro);
14471 __tmp.put_f32_le(self.xmag);
14472 __tmp.put_f32_le(self.ymag);
14473 __tmp.put_f32_le(self.zmag);
14474 __tmp.put_f32_le(self.abs_pressure);
14475 __tmp.put_f32_le(self.diff_pressure);
14476 __tmp.put_f32_le(self.pressure_alt);
14477 __tmp.put_f32_le(self.temperature);
14478 __tmp.put_u16_le(self.fields_updated.bits());
14479 __tmp.put_u8(self.id);
14480 if matches!(version, MavlinkVersion::V2) {
14481 let len = __tmp.len();
14482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14483 } else {
14484 __tmp.len()
14485 }
14486 }
14487}
14488#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
14489#[doc = "id: 234"]
14490#[doc = "Message appropriate for high latency connections like Iridium."]
14491#[derive(Debug, Clone, PartialEq)]
14492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14493#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14494pub struct HIGH_LATENCY_DATA {
14495 #[doc = "A bitfield for use for autopilot-specific flags."]
14496 pub custom_mode: u32,
14497 #[doc = "Latitude"]
14498 pub latitude: i32,
14499 #[doc = "Longitude"]
14500 pub longitude: i32,
14501 #[doc = "roll"]
14502 pub roll: i16,
14503 #[doc = "pitch"]
14504 pub pitch: i16,
14505 #[doc = "heading"]
14506 pub heading: u16,
14507 #[doc = "heading setpoint"]
14508 pub heading_sp: i16,
14509 #[doc = "Altitude above mean sea level"]
14510 pub altitude_amsl: i16,
14511 #[doc = "Altitude setpoint relative to the home position"]
14512 pub altitude_sp: i16,
14513 #[doc = "distance to target"]
14514 pub wp_distance: u16,
14515 #[doc = "Bitmap of enabled system modes."]
14516 pub base_mode: MavModeFlag,
14517 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
14518 pub landed_state: MavLandedState,
14519 #[doc = "throttle (percentage)"]
14520 pub throttle: i8,
14521 #[doc = "airspeed"]
14522 pub airspeed: u8,
14523 #[doc = "airspeed setpoint"]
14524 pub airspeed_sp: u8,
14525 #[doc = "groundspeed"]
14526 pub groundspeed: u8,
14527 #[doc = "climb rate"]
14528 pub climb_rate: i8,
14529 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14530 pub gps_nsat: u8,
14531 #[doc = "GPS Fix type."]
14532 pub gps_fix_type: GpsFixType,
14533 #[doc = "Remaining battery (percentage)"]
14534 pub battery_remaining: u8,
14535 #[doc = "Autopilot temperature (degrees C)"]
14536 pub temperature: i8,
14537 #[doc = "Air temperature (degrees C) from airspeed sensor"]
14538 pub temperature_air: i8,
14539 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
14540 pub failsafe: u8,
14541 #[doc = "current waypoint number"]
14542 pub wp_num: u8,
14543}
14544impl HIGH_LATENCY_DATA {
14545 pub const ENCODED_LEN: usize = 40usize;
14546 pub const DEFAULT: Self = Self {
14547 custom_mode: 0_u32,
14548 latitude: 0_i32,
14549 longitude: 0_i32,
14550 roll: 0_i16,
14551 pitch: 0_i16,
14552 heading: 0_u16,
14553 heading_sp: 0_i16,
14554 altitude_amsl: 0_i16,
14555 altitude_sp: 0_i16,
14556 wp_distance: 0_u16,
14557 base_mode: MavModeFlag::DEFAULT,
14558 landed_state: MavLandedState::DEFAULT,
14559 throttle: 0_i8,
14560 airspeed: 0_u8,
14561 airspeed_sp: 0_u8,
14562 groundspeed: 0_u8,
14563 climb_rate: 0_i8,
14564 gps_nsat: 0_u8,
14565 gps_fix_type: GpsFixType::DEFAULT,
14566 battery_remaining: 0_u8,
14567 temperature: 0_i8,
14568 temperature_air: 0_i8,
14569 failsafe: 0_u8,
14570 wp_num: 0_u8,
14571 };
14572 #[cfg(feature = "arbitrary")]
14573 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14574 use arbitrary::{Arbitrary, Unstructured};
14575 let mut buf = [0u8; 1024];
14576 rng.fill_bytes(&mut buf);
14577 let mut unstructured = Unstructured::new(&buf);
14578 Self::arbitrary(&mut unstructured).unwrap_or_default()
14579 }
14580}
14581impl Default for HIGH_LATENCY_DATA {
14582 fn default() -> Self {
14583 Self::DEFAULT.clone()
14584 }
14585}
14586impl MessageData for HIGH_LATENCY_DATA {
14587 type Message = MavMessage;
14588 const ID: u32 = 234u32;
14589 const NAME: &'static str = "HIGH_LATENCY";
14590 const EXTRA_CRC: u8 = 150u8;
14591 const ENCODED_LEN: usize = 40usize;
14592 fn deser(
14593 _version: MavlinkVersion,
14594 __input: &[u8],
14595 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14596 let avail_len = __input.len();
14597 let mut payload_buf = [0; Self::ENCODED_LEN];
14598 let mut buf = if avail_len < Self::ENCODED_LEN {
14599 payload_buf[0..avail_len].copy_from_slice(__input);
14600 Bytes::new(&payload_buf)
14601 } else {
14602 Bytes::new(__input)
14603 };
14604 let mut __struct = Self::default();
14605 __struct.custom_mode = buf.get_u32_le();
14606 __struct.latitude = buf.get_i32_le();
14607 __struct.longitude = buf.get_i32_le();
14608 __struct.roll = buf.get_i16_le();
14609 __struct.pitch = buf.get_i16_le();
14610 __struct.heading = buf.get_u16_le();
14611 __struct.heading_sp = buf.get_i16_le();
14612 __struct.altitude_amsl = buf.get_i16_le();
14613 __struct.altitude_sp = buf.get_i16_le();
14614 __struct.wp_distance = buf.get_u16_le();
14615 let tmp = buf.get_u8();
14616 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14617 ::mavlink_core::error::ParserError::InvalidFlag {
14618 flag_type: "MavModeFlag",
14619 value: tmp as u32,
14620 },
14621 )?;
14622 let tmp = buf.get_u8();
14623 __struct.landed_state =
14624 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14625 enum_type: "MavLandedState",
14626 value: tmp as u32,
14627 })?;
14628 __struct.throttle = buf.get_i8();
14629 __struct.airspeed = buf.get_u8();
14630 __struct.airspeed_sp = buf.get_u8();
14631 __struct.groundspeed = buf.get_u8();
14632 __struct.climb_rate = buf.get_i8();
14633 __struct.gps_nsat = buf.get_u8();
14634 let tmp = buf.get_u8();
14635 __struct.gps_fix_type =
14636 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14637 enum_type: "GpsFixType",
14638 value: tmp as u32,
14639 })?;
14640 __struct.battery_remaining = buf.get_u8();
14641 __struct.temperature = buf.get_i8();
14642 __struct.temperature_air = buf.get_i8();
14643 __struct.failsafe = buf.get_u8();
14644 __struct.wp_num = buf.get_u8();
14645 Ok(__struct)
14646 }
14647 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14648 let mut __tmp = BytesMut::new(bytes);
14649 #[allow(clippy::absurd_extreme_comparisons)]
14650 #[allow(unused_comparisons)]
14651 if __tmp.remaining() < Self::ENCODED_LEN {
14652 panic!(
14653 "buffer is too small (need {} bytes, but got {})",
14654 Self::ENCODED_LEN,
14655 __tmp.remaining(),
14656 )
14657 }
14658 __tmp.put_u32_le(self.custom_mode);
14659 __tmp.put_i32_le(self.latitude);
14660 __tmp.put_i32_le(self.longitude);
14661 __tmp.put_i16_le(self.roll);
14662 __tmp.put_i16_le(self.pitch);
14663 __tmp.put_u16_le(self.heading);
14664 __tmp.put_i16_le(self.heading_sp);
14665 __tmp.put_i16_le(self.altitude_amsl);
14666 __tmp.put_i16_le(self.altitude_sp);
14667 __tmp.put_u16_le(self.wp_distance);
14668 __tmp.put_u8(self.base_mode.bits());
14669 __tmp.put_u8(self.landed_state as u8);
14670 __tmp.put_i8(self.throttle);
14671 __tmp.put_u8(self.airspeed);
14672 __tmp.put_u8(self.airspeed_sp);
14673 __tmp.put_u8(self.groundspeed);
14674 __tmp.put_i8(self.climb_rate);
14675 __tmp.put_u8(self.gps_nsat);
14676 __tmp.put_u8(self.gps_fix_type as u8);
14677 __tmp.put_u8(self.battery_remaining);
14678 __tmp.put_i8(self.temperature);
14679 __tmp.put_i8(self.temperature_air);
14680 __tmp.put_u8(self.failsafe);
14681 __tmp.put_u8(self.wp_num);
14682 if matches!(version, MavlinkVersion::V2) {
14683 let len = __tmp.len();
14684 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14685 } else {
14686 __tmp.len()
14687 }
14688 }
14689}
14690#[doc = "id: 235"]
14691#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
14692#[derive(Debug, Clone, PartialEq)]
14693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14695pub struct HIGH_LATENCY2_DATA {
14696 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
14697 pub timestamp: u32,
14698 #[doc = "Latitude"]
14699 pub latitude: i32,
14700 #[doc = "Longitude"]
14701 pub longitude: i32,
14702 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
14703 pub custom_mode: u16,
14704 #[doc = "Altitude above mean sea level"]
14705 pub altitude: i16,
14706 #[doc = "Altitude setpoint"]
14707 pub target_altitude: i16,
14708 #[doc = "Distance to target waypoint or position"]
14709 pub target_distance: u16,
14710 #[doc = "Current waypoint number"]
14711 pub wp_num: u16,
14712 #[doc = "Bitmap of failure flags."]
14713 pub failure_flags: HlFailureFlag,
14714 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
14715 pub mavtype: MavType,
14716 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14717 pub autopilot: MavAutopilot,
14718 #[doc = "Heading"]
14719 pub heading: u8,
14720 #[doc = "Heading setpoint"]
14721 pub target_heading: u8,
14722 #[doc = "Throttle"]
14723 pub throttle: u8,
14724 #[doc = "Airspeed"]
14725 pub airspeed: u8,
14726 #[doc = "Airspeed setpoint"]
14727 pub airspeed_sp: u8,
14728 #[doc = "Groundspeed"]
14729 pub groundspeed: u8,
14730 #[doc = "Windspeed"]
14731 pub windspeed: u8,
14732 #[doc = "Wind heading"]
14733 pub wind_heading: u8,
14734 #[doc = "Maximum error horizontal position since last message"]
14735 pub eph: u8,
14736 #[doc = "Maximum error vertical position since last message"]
14737 pub epv: u8,
14738 #[doc = "Air temperature"]
14739 pub temperature_air: i8,
14740 #[doc = "Maximum climb rate magnitude since last message"]
14741 pub climb_rate: i8,
14742 #[doc = "Battery level (-1 if field not provided)."]
14743 pub battery: i8,
14744 #[doc = "Field for custom payload."]
14745 pub custom0: i8,
14746 #[doc = "Field for custom payload."]
14747 pub custom1: i8,
14748 #[doc = "Field for custom payload."]
14749 pub custom2: i8,
14750}
14751impl HIGH_LATENCY2_DATA {
14752 pub const ENCODED_LEN: usize = 42usize;
14753 pub const DEFAULT: Self = Self {
14754 timestamp: 0_u32,
14755 latitude: 0_i32,
14756 longitude: 0_i32,
14757 custom_mode: 0_u16,
14758 altitude: 0_i16,
14759 target_altitude: 0_i16,
14760 target_distance: 0_u16,
14761 wp_num: 0_u16,
14762 failure_flags: HlFailureFlag::DEFAULT,
14763 mavtype: MavType::DEFAULT,
14764 autopilot: MavAutopilot::DEFAULT,
14765 heading: 0_u8,
14766 target_heading: 0_u8,
14767 throttle: 0_u8,
14768 airspeed: 0_u8,
14769 airspeed_sp: 0_u8,
14770 groundspeed: 0_u8,
14771 windspeed: 0_u8,
14772 wind_heading: 0_u8,
14773 eph: 0_u8,
14774 epv: 0_u8,
14775 temperature_air: 0_i8,
14776 climb_rate: 0_i8,
14777 battery: 0_i8,
14778 custom0: 0_i8,
14779 custom1: 0_i8,
14780 custom2: 0_i8,
14781 };
14782 #[cfg(feature = "arbitrary")]
14783 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14784 use arbitrary::{Arbitrary, Unstructured};
14785 let mut buf = [0u8; 1024];
14786 rng.fill_bytes(&mut buf);
14787 let mut unstructured = Unstructured::new(&buf);
14788 Self::arbitrary(&mut unstructured).unwrap_or_default()
14789 }
14790}
14791impl Default for HIGH_LATENCY2_DATA {
14792 fn default() -> Self {
14793 Self::DEFAULT.clone()
14794 }
14795}
14796impl MessageData for HIGH_LATENCY2_DATA {
14797 type Message = MavMessage;
14798 const ID: u32 = 235u32;
14799 const NAME: &'static str = "HIGH_LATENCY2";
14800 const EXTRA_CRC: u8 = 179u8;
14801 const ENCODED_LEN: usize = 42usize;
14802 fn deser(
14803 _version: MavlinkVersion,
14804 __input: &[u8],
14805 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14806 let avail_len = __input.len();
14807 let mut payload_buf = [0; Self::ENCODED_LEN];
14808 let mut buf = if avail_len < Self::ENCODED_LEN {
14809 payload_buf[0..avail_len].copy_from_slice(__input);
14810 Bytes::new(&payload_buf)
14811 } else {
14812 Bytes::new(__input)
14813 };
14814 let mut __struct = Self::default();
14815 __struct.timestamp = buf.get_u32_le();
14816 __struct.latitude = buf.get_i32_le();
14817 __struct.longitude = buf.get_i32_le();
14818 __struct.custom_mode = buf.get_u16_le();
14819 __struct.altitude = buf.get_i16_le();
14820 __struct.target_altitude = buf.get_i16_le();
14821 __struct.target_distance = buf.get_u16_le();
14822 __struct.wp_num = buf.get_u16_le();
14823 let tmp = buf.get_u16_le();
14824 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
14825 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14826 flag_type: "HlFailureFlag",
14827 value: tmp as u32,
14828 })?;
14829 let tmp = buf.get_u8();
14830 __struct.mavtype =
14831 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14832 enum_type: "MavType",
14833 value: tmp as u32,
14834 })?;
14835 let tmp = buf.get_u8();
14836 __struct.autopilot =
14837 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14838 enum_type: "MavAutopilot",
14839 value: tmp as u32,
14840 })?;
14841 __struct.heading = buf.get_u8();
14842 __struct.target_heading = buf.get_u8();
14843 __struct.throttle = buf.get_u8();
14844 __struct.airspeed = buf.get_u8();
14845 __struct.airspeed_sp = buf.get_u8();
14846 __struct.groundspeed = buf.get_u8();
14847 __struct.windspeed = buf.get_u8();
14848 __struct.wind_heading = buf.get_u8();
14849 __struct.eph = buf.get_u8();
14850 __struct.epv = buf.get_u8();
14851 __struct.temperature_air = buf.get_i8();
14852 __struct.climb_rate = buf.get_i8();
14853 __struct.battery = buf.get_i8();
14854 __struct.custom0 = buf.get_i8();
14855 __struct.custom1 = buf.get_i8();
14856 __struct.custom2 = buf.get_i8();
14857 Ok(__struct)
14858 }
14859 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14860 let mut __tmp = BytesMut::new(bytes);
14861 #[allow(clippy::absurd_extreme_comparisons)]
14862 #[allow(unused_comparisons)]
14863 if __tmp.remaining() < Self::ENCODED_LEN {
14864 panic!(
14865 "buffer is too small (need {} bytes, but got {})",
14866 Self::ENCODED_LEN,
14867 __tmp.remaining(),
14868 )
14869 }
14870 __tmp.put_u32_le(self.timestamp);
14871 __tmp.put_i32_le(self.latitude);
14872 __tmp.put_i32_le(self.longitude);
14873 __tmp.put_u16_le(self.custom_mode);
14874 __tmp.put_i16_le(self.altitude);
14875 __tmp.put_i16_le(self.target_altitude);
14876 __tmp.put_u16_le(self.target_distance);
14877 __tmp.put_u16_le(self.wp_num);
14878 __tmp.put_u16_le(self.failure_flags.bits());
14879 __tmp.put_u8(self.mavtype as u8);
14880 __tmp.put_u8(self.autopilot as u8);
14881 __tmp.put_u8(self.heading);
14882 __tmp.put_u8(self.target_heading);
14883 __tmp.put_u8(self.throttle);
14884 __tmp.put_u8(self.airspeed);
14885 __tmp.put_u8(self.airspeed_sp);
14886 __tmp.put_u8(self.groundspeed);
14887 __tmp.put_u8(self.windspeed);
14888 __tmp.put_u8(self.wind_heading);
14889 __tmp.put_u8(self.eph);
14890 __tmp.put_u8(self.epv);
14891 __tmp.put_i8(self.temperature_air);
14892 __tmp.put_i8(self.climb_rate);
14893 __tmp.put_i8(self.battery);
14894 __tmp.put_i8(self.custom0);
14895 __tmp.put_i8(self.custom1);
14896 __tmp.put_i8(self.custom2);
14897 if matches!(version, MavlinkVersion::V2) {
14898 let len = __tmp.len();
14899 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14900 } else {
14901 __tmp.len()
14902 }
14903 }
14904}
14905#[doc = "id: 93"]
14906#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
14907#[derive(Debug, Clone, PartialEq)]
14908#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14909#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14910pub struct HIL_ACTUATOR_CONTROLS_DATA {
14911 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14912 pub time_usec: u64,
14913 #[doc = "Flags bitmask."]
14914 pub flags: HilActuatorControlsFlags,
14915 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
14916 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14917 pub controls: [f32; 16],
14918 #[doc = "System mode. Includes arming state."]
14919 pub mode: MavModeFlag,
14920}
14921impl HIL_ACTUATOR_CONTROLS_DATA {
14922 pub const ENCODED_LEN: usize = 81usize;
14923 pub const DEFAULT: Self = Self {
14924 time_usec: 0_u64,
14925 flags: HilActuatorControlsFlags::DEFAULT,
14926 controls: [0.0_f32; 16usize],
14927 mode: MavModeFlag::DEFAULT,
14928 };
14929 #[cfg(feature = "arbitrary")]
14930 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14931 use arbitrary::{Arbitrary, Unstructured};
14932 let mut buf = [0u8; 1024];
14933 rng.fill_bytes(&mut buf);
14934 let mut unstructured = Unstructured::new(&buf);
14935 Self::arbitrary(&mut unstructured).unwrap_or_default()
14936 }
14937}
14938impl Default for HIL_ACTUATOR_CONTROLS_DATA {
14939 fn default() -> Self {
14940 Self::DEFAULT.clone()
14941 }
14942}
14943impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
14944 type Message = MavMessage;
14945 const ID: u32 = 93u32;
14946 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
14947 const EXTRA_CRC: u8 = 47u8;
14948 const ENCODED_LEN: usize = 81usize;
14949 fn deser(
14950 _version: MavlinkVersion,
14951 __input: &[u8],
14952 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14953 let avail_len = __input.len();
14954 let mut payload_buf = [0; Self::ENCODED_LEN];
14955 let mut buf = if avail_len < Self::ENCODED_LEN {
14956 payload_buf[0..avail_len].copy_from_slice(__input);
14957 Bytes::new(&payload_buf)
14958 } else {
14959 Bytes::new(__input)
14960 };
14961 let mut __struct = Self::default();
14962 __struct.time_usec = buf.get_u64_le();
14963 let tmp = buf.get_u64_le();
14964 __struct.flags =
14965 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
14966 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14967 flag_type: "HilActuatorControlsFlags",
14968 value: tmp as u32,
14969 })?;
14970 for v in &mut __struct.controls {
14971 let val = buf.get_f32_le();
14972 *v = val;
14973 }
14974 let tmp = buf.get_u8();
14975 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14976 ::mavlink_core::error::ParserError::InvalidFlag {
14977 flag_type: "MavModeFlag",
14978 value: tmp as u32,
14979 },
14980 )?;
14981 Ok(__struct)
14982 }
14983 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14984 let mut __tmp = BytesMut::new(bytes);
14985 #[allow(clippy::absurd_extreme_comparisons)]
14986 #[allow(unused_comparisons)]
14987 if __tmp.remaining() < Self::ENCODED_LEN {
14988 panic!(
14989 "buffer is too small (need {} bytes, but got {})",
14990 Self::ENCODED_LEN,
14991 __tmp.remaining(),
14992 )
14993 }
14994 __tmp.put_u64_le(self.time_usec);
14995 __tmp.put_u64_le(self.flags.bits());
14996 for val in &self.controls {
14997 __tmp.put_f32_le(*val);
14998 }
14999 __tmp.put_u8(self.mode.bits());
15000 if matches!(version, MavlinkVersion::V2) {
15001 let len = __tmp.len();
15002 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15003 } else {
15004 __tmp.len()
15005 }
15006 }
15007}
15008#[doc = "id: 91"]
15009#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15010#[derive(Debug, Clone, PartialEq)]
15011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15013pub struct HIL_CONTROLS_DATA {
15014 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15015 pub time_usec: u64,
15016 #[doc = "Control output -1 .. 1"]
15017 pub roll_ailerons: f32,
15018 #[doc = "Control output -1 .. 1"]
15019 pub pitch_elevator: f32,
15020 #[doc = "Control output -1 .. 1"]
15021 pub yaw_rudder: f32,
15022 #[doc = "Throttle 0 .. 1"]
15023 pub throttle: f32,
15024 #[doc = "Aux 1, -1 .. 1"]
15025 pub aux1: f32,
15026 #[doc = "Aux 2, -1 .. 1"]
15027 pub aux2: f32,
15028 #[doc = "Aux 3, -1 .. 1"]
15029 pub aux3: f32,
15030 #[doc = "Aux 4, -1 .. 1"]
15031 pub aux4: f32,
15032 #[doc = "System mode."]
15033 pub mode: MavMode,
15034 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15035 pub nav_mode: u8,
15036}
15037impl HIL_CONTROLS_DATA {
15038 pub const ENCODED_LEN: usize = 42usize;
15039 pub const DEFAULT: Self = Self {
15040 time_usec: 0_u64,
15041 roll_ailerons: 0.0_f32,
15042 pitch_elevator: 0.0_f32,
15043 yaw_rudder: 0.0_f32,
15044 throttle: 0.0_f32,
15045 aux1: 0.0_f32,
15046 aux2: 0.0_f32,
15047 aux3: 0.0_f32,
15048 aux4: 0.0_f32,
15049 mode: MavMode::DEFAULT,
15050 nav_mode: 0_u8,
15051 };
15052 #[cfg(feature = "arbitrary")]
15053 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15054 use arbitrary::{Arbitrary, Unstructured};
15055 let mut buf = [0u8; 1024];
15056 rng.fill_bytes(&mut buf);
15057 let mut unstructured = Unstructured::new(&buf);
15058 Self::arbitrary(&mut unstructured).unwrap_or_default()
15059 }
15060}
15061impl Default for HIL_CONTROLS_DATA {
15062 fn default() -> Self {
15063 Self::DEFAULT.clone()
15064 }
15065}
15066impl MessageData for HIL_CONTROLS_DATA {
15067 type Message = MavMessage;
15068 const ID: u32 = 91u32;
15069 const NAME: &'static str = "HIL_CONTROLS";
15070 const EXTRA_CRC: u8 = 63u8;
15071 const ENCODED_LEN: usize = 42usize;
15072 fn deser(
15073 _version: MavlinkVersion,
15074 __input: &[u8],
15075 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15076 let avail_len = __input.len();
15077 let mut payload_buf = [0; Self::ENCODED_LEN];
15078 let mut buf = if avail_len < Self::ENCODED_LEN {
15079 payload_buf[0..avail_len].copy_from_slice(__input);
15080 Bytes::new(&payload_buf)
15081 } else {
15082 Bytes::new(__input)
15083 };
15084 let mut __struct = Self::default();
15085 __struct.time_usec = buf.get_u64_le();
15086 __struct.roll_ailerons = buf.get_f32_le();
15087 __struct.pitch_elevator = buf.get_f32_le();
15088 __struct.yaw_rudder = buf.get_f32_le();
15089 __struct.throttle = buf.get_f32_le();
15090 __struct.aux1 = buf.get_f32_le();
15091 __struct.aux2 = buf.get_f32_le();
15092 __struct.aux3 = buf.get_f32_le();
15093 __struct.aux4 = buf.get_f32_le();
15094 let tmp = buf.get_u8();
15095 __struct.mode =
15096 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15097 enum_type: "MavMode",
15098 value: tmp as u32,
15099 })?;
15100 __struct.nav_mode = buf.get_u8();
15101 Ok(__struct)
15102 }
15103 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15104 let mut __tmp = BytesMut::new(bytes);
15105 #[allow(clippy::absurd_extreme_comparisons)]
15106 #[allow(unused_comparisons)]
15107 if __tmp.remaining() < Self::ENCODED_LEN {
15108 panic!(
15109 "buffer is too small (need {} bytes, but got {})",
15110 Self::ENCODED_LEN,
15111 __tmp.remaining(),
15112 )
15113 }
15114 __tmp.put_u64_le(self.time_usec);
15115 __tmp.put_f32_le(self.roll_ailerons);
15116 __tmp.put_f32_le(self.pitch_elevator);
15117 __tmp.put_f32_le(self.yaw_rudder);
15118 __tmp.put_f32_le(self.throttle);
15119 __tmp.put_f32_le(self.aux1);
15120 __tmp.put_f32_le(self.aux2);
15121 __tmp.put_f32_le(self.aux3);
15122 __tmp.put_f32_le(self.aux4);
15123 __tmp.put_u8(self.mode as u8);
15124 __tmp.put_u8(self.nav_mode);
15125 if matches!(version, MavlinkVersion::V2) {
15126 let len = __tmp.len();
15127 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15128 } else {
15129 __tmp.len()
15130 }
15131 }
15132}
15133#[doc = "id: 113"]
15134#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15135#[derive(Debug, Clone, PartialEq)]
15136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15138pub struct HIL_GPS_DATA {
15139 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15140 pub time_usec: u64,
15141 #[doc = "Latitude (WGS84)"]
15142 pub lat: i32,
15143 #[doc = "Longitude (WGS84)"]
15144 pub lon: i32,
15145 #[doc = "Altitude (MSL). Positive for up."]
15146 pub alt: i32,
15147 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15148 pub eph: u16,
15149 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15150 pub epv: u16,
15151 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15152 pub vel: u16,
15153 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15154 pub vn: i16,
15155 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15156 pub ve: i16,
15157 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15158 pub vd: i16,
15159 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15160 pub cog: u16,
15161 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15162 pub fix_type: u8,
15163 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15164 pub satellites_visible: u8,
15165 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15166 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15167 pub id: u8,
15168 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15169 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15170 pub yaw: u16,
15171}
15172impl HIL_GPS_DATA {
15173 pub const ENCODED_LEN: usize = 39usize;
15174 pub const DEFAULT: Self = Self {
15175 time_usec: 0_u64,
15176 lat: 0_i32,
15177 lon: 0_i32,
15178 alt: 0_i32,
15179 eph: 0_u16,
15180 epv: 0_u16,
15181 vel: 0_u16,
15182 vn: 0_i16,
15183 ve: 0_i16,
15184 vd: 0_i16,
15185 cog: 0_u16,
15186 fix_type: 0_u8,
15187 satellites_visible: 0_u8,
15188 id: 0_u8,
15189 yaw: 0_u16,
15190 };
15191 #[cfg(feature = "arbitrary")]
15192 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15193 use arbitrary::{Arbitrary, Unstructured};
15194 let mut buf = [0u8; 1024];
15195 rng.fill_bytes(&mut buf);
15196 let mut unstructured = Unstructured::new(&buf);
15197 Self::arbitrary(&mut unstructured).unwrap_or_default()
15198 }
15199}
15200impl Default for HIL_GPS_DATA {
15201 fn default() -> Self {
15202 Self::DEFAULT.clone()
15203 }
15204}
15205impl MessageData for HIL_GPS_DATA {
15206 type Message = MavMessage;
15207 const ID: u32 = 113u32;
15208 const NAME: &'static str = "HIL_GPS";
15209 const EXTRA_CRC: u8 = 124u8;
15210 const ENCODED_LEN: usize = 39usize;
15211 fn deser(
15212 _version: MavlinkVersion,
15213 __input: &[u8],
15214 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15215 let avail_len = __input.len();
15216 let mut payload_buf = [0; Self::ENCODED_LEN];
15217 let mut buf = if avail_len < Self::ENCODED_LEN {
15218 payload_buf[0..avail_len].copy_from_slice(__input);
15219 Bytes::new(&payload_buf)
15220 } else {
15221 Bytes::new(__input)
15222 };
15223 let mut __struct = Self::default();
15224 __struct.time_usec = buf.get_u64_le();
15225 __struct.lat = buf.get_i32_le();
15226 __struct.lon = buf.get_i32_le();
15227 __struct.alt = buf.get_i32_le();
15228 __struct.eph = buf.get_u16_le();
15229 __struct.epv = buf.get_u16_le();
15230 __struct.vel = buf.get_u16_le();
15231 __struct.vn = buf.get_i16_le();
15232 __struct.ve = buf.get_i16_le();
15233 __struct.vd = buf.get_i16_le();
15234 __struct.cog = buf.get_u16_le();
15235 __struct.fix_type = buf.get_u8();
15236 __struct.satellites_visible = buf.get_u8();
15237 __struct.id = buf.get_u8();
15238 __struct.yaw = buf.get_u16_le();
15239 Ok(__struct)
15240 }
15241 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15242 let mut __tmp = BytesMut::new(bytes);
15243 #[allow(clippy::absurd_extreme_comparisons)]
15244 #[allow(unused_comparisons)]
15245 if __tmp.remaining() < Self::ENCODED_LEN {
15246 panic!(
15247 "buffer is too small (need {} bytes, but got {})",
15248 Self::ENCODED_LEN,
15249 __tmp.remaining(),
15250 )
15251 }
15252 __tmp.put_u64_le(self.time_usec);
15253 __tmp.put_i32_le(self.lat);
15254 __tmp.put_i32_le(self.lon);
15255 __tmp.put_i32_le(self.alt);
15256 __tmp.put_u16_le(self.eph);
15257 __tmp.put_u16_le(self.epv);
15258 __tmp.put_u16_le(self.vel);
15259 __tmp.put_i16_le(self.vn);
15260 __tmp.put_i16_le(self.ve);
15261 __tmp.put_i16_le(self.vd);
15262 __tmp.put_u16_le(self.cog);
15263 __tmp.put_u8(self.fix_type);
15264 __tmp.put_u8(self.satellites_visible);
15265 __tmp.put_u8(self.id);
15266 __tmp.put_u16_le(self.yaw);
15267 if matches!(version, MavlinkVersion::V2) {
15268 let len = __tmp.len();
15269 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15270 } else {
15271 __tmp.len()
15272 }
15273 }
15274}
15275#[doc = "id: 114"]
15276#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15277#[derive(Debug, Clone, PartialEq)]
15278#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15280pub struct HIL_OPTICAL_FLOW_DATA {
15281 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15282 pub time_usec: u64,
15283 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15284 pub integration_time_us: u32,
15285 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15286 pub integrated_x: f32,
15287 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15288 pub integrated_y: f32,
15289 #[doc = "RH rotation around X axis"]
15290 pub integrated_xgyro: f32,
15291 #[doc = "RH rotation around Y axis"]
15292 pub integrated_ygyro: f32,
15293 #[doc = "RH rotation around Z axis"]
15294 pub integrated_zgyro: f32,
15295 #[doc = "Time since the distance was sampled."]
15296 pub time_delta_distance_us: u32,
15297 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15298 pub distance: f32,
15299 #[doc = "Temperature"]
15300 pub temperature: i16,
15301 #[doc = "Sensor ID"]
15302 pub sensor_id: u8,
15303 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15304 pub quality: u8,
15305}
15306impl HIL_OPTICAL_FLOW_DATA {
15307 pub const ENCODED_LEN: usize = 44usize;
15308 pub const DEFAULT: Self = Self {
15309 time_usec: 0_u64,
15310 integration_time_us: 0_u32,
15311 integrated_x: 0.0_f32,
15312 integrated_y: 0.0_f32,
15313 integrated_xgyro: 0.0_f32,
15314 integrated_ygyro: 0.0_f32,
15315 integrated_zgyro: 0.0_f32,
15316 time_delta_distance_us: 0_u32,
15317 distance: 0.0_f32,
15318 temperature: 0_i16,
15319 sensor_id: 0_u8,
15320 quality: 0_u8,
15321 };
15322 #[cfg(feature = "arbitrary")]
15323 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15324 use arbitrary::{Arbitrary, Unstructured};
15325 let mut buf = [0u8; 1024];
15326 rng.fill_bytes(&mut buf);
15327 let mut unstructured = Unstructured::new(&buf);
15328 Self::arbitrary(&mut unstructured).unwrap_or_default()
15329 }
15330}
15331impl Default for HIL_OPTICAL_FLOW_DATA {
15332 fn default() -> Self {
15333 Self::DEFAULT.clone()
15334 }
15335}
15336impl MessageData for HIL_OPTICAL_FLOW_DATA {
15337 type Message = MavMessage;
15338 const ID: u32 = 114u32;
15339 const NAME: &'static str = "HIL_OPTICAL_FLOW";
15340 const EXTRA_CRC: u8 = 237u8;
15341 const ENCODED_LEN: usize = 44usize;
15342 fn deser(
15343 _version: MavlinkVersion,
15344 __input: &[u8],
15345 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15346 let avail_len = __input.len();
15347 let mut payload_buf = [0; Self::ENCODED_LEN];
15348 let mut buf = if avail_len < Self::ENCODED_LEN {
15349 payload_buf[0..avail_len].copy_from_slice(__input);
15350 Bytes::new(&payload_buf)
15351 } else {
15352 Bytes::new(__input)
15353 };
15354 let mut __struct = Self::default();
15355 __struct.time_usec = buf.get_u64_le();
15356 __struct.integration_time_us = buf.get_u32_le();
15357 __struct.integrated_x = buf.get_f32_le();
15358 __struct.integrated_y = buf.get_f32_le();
15359 __struct.integrated_xgyro = buf.get_f32_le();
15360 __struct.integrated_ygyro = buf.get_f32_le();
15361 __struct.integrated_zgyro = buf.get_f32_le();
15362 __struct.time_delta_distance_us = buf.get_u32_le();
15363 __struct.distance = buf.get_f32_le();
15364 __struct.temperature = buf.get_i16_le();
15365 __struct.sensor_id = buf.get_u8();
15366 __struct.quality = buf.get_u8();
15367 Ok(__struct)
15368 }
15369 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15370 let mut __tmp = BytesMut::new(bytes);
15371 #[allow(clippy::absurd_extreme_comparisons)]
15372 #[allow(unused_comparisons)]
15373 if __tmp.remaining() < Self::ENCODED_LEN {
15374 panic!(
15375 "buffer is too small (need {} bytes, but got {})",
15376 Self::ENCODED_LEN,
15377 __tmp.remaining(),
15378 )
15379 }
15380 __tmp.put_u64_le(self.time_usec);
15381 __tmp.put_u32_le(self.integration_time_us);
15382 __tmp.put_f32_le(self.integrated_x);
15383 __tmp.put_f32_le(self.integrated_y);
15384 __tmp.put_f32_le(self.integrated_xgyro);
15385 __tmp.put_f32_le(self.integrated_ygyro);
15386 __tmp.put_f32_le(self.integrated_zgyro);
15387 __tmp.put_u32_le(self.time_delta_distance_us);
15388 __tmp.put_f32_le(self.distance);
15389 __tmp.put_i16_le(self.temperature);
15390 __tmp.put_u8(self.sensor_id);
15391 __tmp.put_u8(self.quality);
15392 if matches!(version, MavlinkVersion::V2) {
15393 let len = __tmp.len();
15394 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15395 } else {
15396 __tmp.len()
15397 }
15398 }
15399}
15400#[doc = "id: 92"]
15401#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
15402#[derive(Debug, Clone, PartialEq)]
15403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15404#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15405pub struct HIL_RC_INPUTS_RAW_DATA {
15406 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15407 pub time_usec: u64,
15408 #[doc = "RC channel 1 value"]
15409 pub chan1_raw: u16,
15410 #[doc = "RC channel 2 value"]
15411 pub chan2_raw: u16,
15412 #[doc = "RC channel 3 value"]
15413 pub chan3_raw: u16,
15414 #[doc = "RC channel 4 value"]
15415 pub chan4_raw: u16,
15416 #[doc = "RC channel 5 value"]
15417 pub chan5_raw: u16,
15418 #[doc = "RC channel 6 value"]
15419 pub chan6_raw: u16,
15420 #[doc = "RC channel 7 value"]
15421 pub chan7_raw: u16,
15422 #[doc = "RC channel 8 value"]
15423 pub chan8_raw: u16,
15424 #[doc = "RC channel 9 value"]
15425 pub chan9_raw: u16,
15426 #[doc = "RC channel 10 value"]
15427 pub chan10_raw: u16,
15428 #[doc = "RC channel 11 value"]
15429 pub chan11_raw: u16,
15430 #[doc = "RC channel 12 value"]
15431 pub chan12_raw: u16,
15432 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
15433 pub rssi: u8,
15434}
15435impl HIL_RC_INPUTS_RAW_DATA {
15436 pub const ENCODED_LEN: usize = 33usize;
15437 pub const DEFAULT: Self = Self {
15438 time_usec: 0_u64,
15439 chan1_raw: 0_u16,
15440 chan2_raw: 0_u16,
15441 chan3_raw: 0_u16,
15442 chan4_raw: 0_u16,
15443 chan5_raw: 0_u16,
15444 chan6_raw: 0_u16,
15445 chan7_raw: 0_u16,
15446 chan8_raw: 0_u16,
15447 chan9_raw: 0_u16,
15448 chan10_raw: 0_u16,
15449 chan11_raw: 0_u16,
15450 chan12_raw: 0_u16,
15451 rssi: 0_u8,
15452 };
15453 #[cfg(feature = "arbitrary")]
15454 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15455 use arbitrary::{Arbitrary, Unstructured};
15456 let mut buf = [0u8; 1024];
15457 rng.fill_bytes(&mut buf);
15458 let mut unstructured = Unstructured::new(&buf);
15459 Self::arbitrary(&mut unstructured).unwrap_or_default()
15460 }
15461}
15462impl Default for HIL_RC_INPUTS_RAW_DATA {
15463 fn default() -> Self {
15464 Self::DEFAULT.clone()
15465 }
15466}
15467impl MessageData for HIL_RC_INPUTS_RAW_DATA {
15468 type Message = MavMessage;
15469 const ID: u32 = 92u32;
15470 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
15471 const EXTRA_CRC: u8 = 54u8;
15472 const ENCODED_LEN: usize = 33usize;
15473 fn deser(
15474 _version: MavlinkVersion,
15475 __input: &[u8],
15476 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15477 let avail_len = __input.len();
15478 let mut payload_buf = [0; Self::ENCODED_LEN];
15479 let mut buf = if avail_len < Self::ENCODED_LEN {
15480 payload_buf[0..avail_len].copy_from_slice(__input);
15481 Bytes::new(&payload_buf)
15482 } else {
15483 Bytes::new(__input)
15484 };
15485 let mut __struct = Self::default();
15486 __struct.time_usec = buf.get_u64_le();
15487 __struct.chan1_raw = buf.get_u16_le();
15488 __struct.chan2_raw = buf.get_u16_le();
15489 __struct.chan3_raw = buf.get_u16_le();
15490 __struct.chan4_raw = buf.get_u16_le();
15491 __struct.chan5_raw = buf.get_u16_le();
15492 __struct.chan6_raw = buf.get_u16_le();
15493 __struct.chan7_raw = buf.get_u16_le();
15494 __struct.chan8_raw = buf.get_u16_le();
15495 __struct.chan9_raw = buf.get_u16_le();
15496 __struct.chan10_raw = buf.get_u16_le();
15497 __struct.chan11_raw = buf.get_u16_le();
15498 __struct.chan12_raw = buf.get_u16_le();
15499 __struct.rssi = buf.get_u8();
15500 Ok(__struct)
15501 }
15502 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15503 let mut __tmp = BytesMut::new(bytes);
15504 #[allow(clippy::absurd_extreme_comparisons)]
15505 #[allow(unused_comparisons)]
15506 if __tmp.remaining() < Self::ENCODED_LEN {
15507 panic!(
15508 "buffer is too small (need {} bytes, but got {})",
15509 Self::ENCODED_LEN,
15510 __tmp.remaining(),
15511 )
15512 }
15513 __tmp.put_u64_le(self.time_usec);
15514 __tmp.put_u16_le(self.chan1_raw);
15515 __tmp.put_u16_le(self.chan2_raw);
15516 __tmp.put_u16_le(self.chan3_raw);
15517 __tmp.put_u16_le(self.chan4_raw);
15518 __tmp.put_u16_le(self.chan5_raw);
15519 __tmp.put_u16_le(self.chan6_raw);
15520 __tmp.put_u16_le(self.chan7_raw);
15521 __tmp.put_u16_le(self.chan8_raw);
15522 __tmp.put_u16_le(self.chan9_raw);
15523 __tmp.put_u16_le(self.chan10_raw);
15524 __tmp.put_u16_le(self.chan11_raw);
15525 __tmp.put_u16_le(self.chan12_raw);
15526 __tmp.put_u8(self.rssi);
15527 if matches!(version, MavlinkVersion::V2) {
15528 let len = __tmp.len();
15529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15530 } else {
15531 __tmp.len()
15532 }
15533 }
15534}
15535#[doc = "id: 107"]
15536#[doc = "The IMU readings in SI units in NED body frame."]
15537#[derive(Debug, Clone, PartialEq)]
15538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15540pub struct HIL_SENSOR_DATA {
15541 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15542 pub time_usec: u64,
15543 #[doc = "X acceleration"]
15544 pub xacc: f32,
15545 #[doc = "Y acceleration"]
15546 pub yacc: f32,
15547 #[doc = "Z acceleration"]
15548 pub zacc: f32,
15549 #[doc = "Angular speed around X axis in body frame"]
15550 pub xgyro: f32,
15551 #[doc = "Angular speed around Y axis in body frame"]
15552 pub ygyro: f32,
15553 #[doc = "Angular speed around Z axis in body frame"]
15554 pub zgyro: f32,
15555 #[doc = "X Magnetic field"]
15556 pub xmag: f32,
15557 #[doc = "Y Magnetic field"]
15558 pub ymag: f32,
15559 #[doc = "Z Magnetic field"]
15560 pub zmag: f32,
15561 #[doc = "Absolute pressure"]
15562 pub abs_pressure: f32,
15563 #[doc = "Differential pressure (airspeed)"]
15564 pub diff_pressure: f32,
15565 #[doc = "Altitude calculated from pressure"]
15566 pub pressure_alt: f32,
15567 #[doc = "Temperature"]
15568 pub temperature: f32,
15569 #[doc = "Bitmap for fields that have updated since last message"]
15570 pub fields_updated: HilSensorUpdatedFlags,
15571 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
15572 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15573 pub id: u8,
15574}
15575impl HIL_SENSOR_DATA {
15576 pub const ENCODED_LEN: usize = 65usize;
15577 pub const DEFAULT: Self = Self {
15578 time_usec: 0_u64,
15579 xacc: 0.0_f32,
15580 yacc: 0.0_f32,
15581 zacc: 0.0_f32,
15582 xgyro: 0.0_f32,
15583 ygyro: 0.0_f32,
15584 zgyro: 0.0_f32,
15585 xmag: 0.0_f32,
15586 ymag: 0.0_f32,
15587 zmag: 0.0_f32,
15588 abs_pressure: 0.0_f32,
15589 diff_pressure: 0.0_f32,
15590 pressure_alt: 0.0_f32,
15591 temperature: 0.0_f32,
15592 fields_updated: HilSensorUpdatedFlags::DEFAULT,
15593 id: 0_u8,
15594 };
15595 #[cfg(feature = "arbitrary")]
15596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15597 use arbitrary::{Arbitrary, Unstructured};
15598 let mut buf = [0u8; 1024];
15599 rng.fill_bytes(&mut buf);
15600 let mut unstructured = Unstructured::new(&buf);
15601 Self::arbitrary(&mut unstructured).unwrap_or_default()
15602 }
15603}
15604impl Default for HIL_SENSOR_DATA {
15605 fn default() -> Self {
15606 Self::DEFAULT.clone()
15607 }
15608}
15609impl MessageData for HIL_SENSOR_DATA {
15610 type Message = MavMessage;
15611 const ID: u32 = 107u32;
15612 const NAME: &'static str = "HIL_SENSOR";
15613 const EXTRA_CRC: u8 = 108u8;
15614 const ENCODED_LEN: usize = 65usize;
15615 fn deser(
15616 _version: MavlinkVersion,
15617 __input: &[u8],
15618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15619 let avail_len = __input.len();
15620 let mut payload_buf = [0; Self::ENCODED_LEN];
15621 let mut buf = if avail_len < Self::ENCODED_LEN {
15622 payload_buf[0..avail_len].copy_from_slice(__input);
15623 Bytes::new(&payload_buf)
15624 } else {
15625 Bytes::new(__input)
15626 };
15627 let mut __struct = Self::default();
15628 __struct.time_usec = buf.get_u64_le();
15629 __struct.xacc = buf.get_f32_le();
15630 __struct.yacc = buf.get_f32_le();
15631 __struct.zacc = buf.get_f32_le();
15632 __struct.xgyro = buf.get_f32_le();
15633 __struct.ygyro = buf.get_f32_le();
15634 __struct.zgyro = buf.get_f32_le();
15635 __struct.xmag = buf.get_f32_le();
15636 __struct.ymag = buf.get_f32_le();
15637 __struct.zmag = buf.get_f32_le();
15638 __struct.abs_pressure = buf.get_f32_le();
15639 __struct.diff_pressure = buf.get_f32_le();
15640 __struct.pressure_alt = buf.get_f32_le();
15641 __struct.temperature = buf.get_f32_le();
15642 let tmp = buf.get_u32_le();
15643 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
15644 tmp & HilSensorUpdatedFlags::all().bits(),
15645 )
15646 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15647 flag_type: "HilSensorUpdatedFlags",
15648 value: tmp as u32,
15649 })?;
15650 __struct.id = buf.get_u8();
15651 Ok(__struct)
15652 }
15653 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15654 let mut __tmp = BytesMut::new(bytes);
15655 #[allow(clippy::absurd_extreme_comparisons)]
15656 #[allow(unused_comparisons)]
15657 if __tmp.remaining() < Self::ENCODED_LEN {
15658 panic!(
15659 "buffer is too small (need {} bytes, but got {})",
15660 Self::ENCODED_LEN,
15661 __tmp.remaining(),
15662 )
15663 }
15664 __tmp.put_u64_le(self.time_usec);
15665 __tmp.put_f32_le(self.xacc);
15666 __tmp.put_f32_le(self.yacc);
15667 __tmp.put_f32_le(self.zacc);
15668 __tmp.put_f32_le(self.xgyro);
15669 __tmp.put_f32_le(self.ygyro);
15670 __tmp.put_f32_le(self.zgyro);
15671 __tmp.put_f32_le(self.xmag);
15672 __tmp.put_f32_le(self.ymag);
15673 __tmp.put_f32_le(self.zmag);
15674 __tmp.put_f32_le(self.abs_pressure);
15675 __tmp.put_f32_le(self.diff_pressure);
15676 __tmp.put_f32_le(self.pressure_alt);
15677 __tmp.put_f32_le(self.temperature);
15678 __tmp.put_u32_le(self.fields_updated.bits());
15679 __tmp.put_u8(self.id);
15680 if matches!(version, MavlinkVersion::V2) {
15681 let len = __tmp.len();
15682 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15683 } else {
15684 __tmp.len()
15685 }
15686 }
15687}
15688#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
15689#[doc = "id: 90"]
15690#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
15691#[derive(Debug, Clone, PartialEq)]
15692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15693#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15694pub struct HIL_STATE_DATA {
15695 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15696 pub time_usec: u64,
15697 #[doc = "Roll angle"]
15698 pub roll: f32,
15699 #[doc = "Pitch angle"]
15700 pub pitch: f32,
15701 #[doc = "Yaw angle"]
15702 pub yaw: f32,
15703 #[doc = "Body frame roll / phi angular speed"]
15704 pub rollspeed: f32,
15705 #[doc = "Body frame pitch / theta angular speed"]
15706 pub pitchspeed: f32,
15707 #[doc = "Body frame yaw / psi angular speed"]
15708 pub yawspeed: f32,
15709 #[doc = "Latitude"]
15710 pub lat: i32,
15711 #[doc = "Longitude"]
15712 pub lon: i32,
15713 #[doc = "Altitude"]
15714 pub alt: i32,
15715 #[doc = "Ground X Speed (Latitude)"]
15716 pub vx: i16,
15717 #[doc = "Ground Y Speed (Longitude)"]
15718 pub vy: i16,
15719 #[doc = "Ground Z Speed (Altitude)"]
15720 pub vz: i16,
15721 #[doc = "X acceleration"]
15722 pub xacc: i16,
15723 #[doc = "Y acceleration"]
15724 pub yacc: i16,
15725 #[doc = "Z acceleration"]
15726 pub zacc: i16,
15727}
15728impl HIL_STATE_DATA {
15729 pub const ENCODED_LEN: usize = 56usize;
15730 pub const DEFAULT: Self = Self {
15731 time_usec: 0_u64,
15732 roll: 0.0_f32,
15733 pitch: 0.0_f32,
15734 yaw: 0.0_f32,
15735 rollspeed: 0.0_f32,
15736 pitchspeed: 0.0_f32,
15737 yawspeed: 0.0_f32,
15738 lat: 0_i32,
15739 lon: 0_i32,
15740 alt: 0_i32,
15741 vx: 0_i16,
15742 vy: 0_i16,
15743 vz: 0_i16,
15744 xacc: 0_i16,
15745 yacc: 0_i16,
15746 zacc: 0_i16,
15747 };
15748 #[cfg(feature = "arbitrary")]
15749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15750 use arbitrary::{Arbitrary, Unstructured};
15751 let mut buf = [0u8; 1024];
15752 rng.fill_bytes(&mut buf);
15753 let mut unstructured = Unstructured::new(&buf);
15754 Self::arbitrary(&mut unstructured).unwrap_or_default()
15755 }
15756}
15757impl Default for HIL_STATE_DATA {
15758 fn default() -> Self {
15759 Self::DEFAULT.clone()
15760 }
15761}
15762impl MessageData for HIL_STATE_DATA {
15763 type Message = MavMessage;
15764 const ID: u32 = 90u32;
15765 const NAME: &'static str = "HIL_STATE";
15766 const EXTRA_CRC: u8 = 183u8;
15767 const ENCODED_LEN: usize = 56usize;
15768 fn deser(
15769 _version: MavlinkVersion,
15770 __input: &[u8],
15771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15772 let avail_len = __input.len();
15773 let mut payload_buf = [0; Self::ENCODED_LEN];
15774 let mut buf = if avail_len < Self::ENCODED_LEN {
15775 payload_buf[0..avail_len].copy_from_slice(__input);
15776 Bytes::new(&payload_buf)
15777 } else {
15778 Bytes::new(__input)
15779 };
15780 let mut __struct = Self::default();
15781 __struct.time_usec = buf.get_u64_le();
15782 __struct.roll = buf.get_f32_le();
15783 __struct.pitch = buf.get_f32_le();
15784 __struct.yaw = buf.get_f32_le();
15785 __struct.rollspeed = buf.get_f32_le();
15786 __struct.pitchspeed = buf.get_f32_le();
15787 __struct.yawspeed = buf.get_f32_le();
15788 __struct.lat = buf.get_i32_le();
15789 __struct.lon = buf.get_i32_le();
15790 __struct.alt = buf.get_i32_le();
15791 __struct.vx = buf.get_i16_le();
15792 __struct.vy = buf.get_i16_le();
15793 __struct.vz = buf.get_i16_le();
15794 __struct.xacc = buf.get_i16_le();
15795 __struct.yacc = buf.get_i16_le();
15796 __struct.zacc = buf.get_i16_le();
15797 Ok(__struct)
15798 }
15799 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15800 let mut __tmp = BytesMut::new(bytes);
15801 #[allow(clippy::absurd_extreme_comparisons)]
15802 #[allow(unused_comparisons)]
15803 if __tmp.remaining() < Self::ENCODED_LEN {
15804 panic!(
15805 "buffer is too small (need {} bytes, but got {})",
15806 Self::ENCODED_LEN,
15807 __tmp.remaining(),
15808 )
15809 }
15810 __tmp.put_u64_le(self.time_usec);
15811 __tmp.put_f32_le(self.roll);
15812 __tmp.put_f32_le(self.pitch);
15813 __tmp.put_f32_le(self.yaw);
15814 __tmp.put_f32_le(self.rollspeed);
15815 __tmp.put_f32_le(self.pitchspeed);
15816 __tmp.put_f32_le(self.yawspeed);
15817 __tmp.put_i32_le(self.lat);
15818 __tmp.put_i32_le(self.lon);
15819 __tmp.put_i32_le(self.alt);
15820 __tmp.put_i16_le(self.vx);
15821 __tmp.put_i16_le(self.vy);
15822 __tmp.put_i16_le(self.vz);
15823 __tmp.put_i16_le(self.xacc);
15824 __tmp.put_i16_le(self.yacc);
15825 __tmp.put_i16_le(self.zacc);
15826 if matches!(version, MavlinkVersion::V2) {
15827 let len = __tmp.len();
15828 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15829 } else {
15830 __tmp.len()
15831 }
15832 }
15833}
15834#[doc = "id: 115"]
15835#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
15836#[derive(Debug, Clone, PartialEq)]
15837#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15839pub struct HIL_STATE_QUATERNION_DATA {
15840 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15841 pub time_usec: u64,
15842 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
15843 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15844 pub attitude_quaternion: [f32; 4],
15845 #[doc = "Body frame roll / phi angular speed"]
15846 pub rollspeed: f32,
15847 #[doc = "Body frame pitch / theta angular speed"]
15848 pub pitchspeed: f32,
15849 #[doc = "Body frame yaw / psi angular speed"]
15850 pub yawspeed: f32,
15851 #[doc = "Latitude"]
15852 pub lat: i32,
15853 #[doc = "Longitude"]
15854 pub lon: i32,
15855 #[doc = "Altitude"]
15856 pub alt: i32,
15857 #[doc = "Ground X Speed (Latitude)"]
15858 pub vx: i16,
15859 #[doc = "Ground Y Speed (Longitude)"]
15860 pub vy: i16,
15861 #[doc = "Ground Z Speed (Altitude)"]
15862 pub vz: i16,
15863 #[doc = "Indicated airspeed"]
15864 pub ind_airspeed: u16,
15865 #[doc = "True airspeed"]
15866 pub true_airspeed: u16,
15867 #[doc = "X acceleration"]
15868 pub xacc: i16,
15869 #[doc = "Y acceleration"]
15870 pub yacc: i16,
15871 #[doc = "Z acceleration"]
15872 pub zacc: i16,
15873}
15874impl HIL_STATE_QUATERNION_DATA {
15875 pub const ENCODED_LEN: usize = 64usize;
15876 pub const DEFAULT: Self = Self {
15877 time_usec: 0_u64,
15878 attitude_quaternion: [0.0_f32; 4usize],
15879 rollspeed: 0.0_f32,
15880 pitchspeed: 0.0_f32,
15881 yawspeed: 0.0_f32,
15882 lat: 0_i32,
15883 lon: 0_i32,
15884 alt: 0_i32,
15885 vx: 0_i16,
15886 vy: 0_i16,
15887 vz: 0_i16,
15888 ind_airspeed: 0_u16,
15889 true_airspeed: 0_u16,
15890 xacc: 0_i16,
15891 yacc: 0_i16,
15892 zacc: 0_i16,
15893 };
15894 #[cfg(feature = "arbitrary")]
15895 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15896 use arbitrary::{Arbitrary, Unstructured};
15897 let mut buf = [0u8; 1024];
15898 rng.fill_bytes(&mut buf);
15899 let mut unstructured = Unstructured::new(&buf);
15900 Self::arbitrary(&mut unstructured).unwrap_or_default()
15901 }
15902}
15903impl Default for HIL_STATE_QUATERNION_DATA {
15904 fn default() -> Self {
15905 Self::DEFAULT.clone()
15906 }
15907}
15908impl MessageData for HIL_STATE_QUATERNION_DATA {
15909 type Message = MavMessage;
15910 const ID: u32 = 115u32;
15911 const NAME: &'static str = "HIL_STATE_QUATERNION";
15912 const EXTRA_CRC: u8 = 4u8;
15913 const ENCODED_LEN: usize = 64usize;
15914 fn deser(
15915 _version: MavlinkVersion,
15916 __input: &[u8],
15917 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15918 let avail_len = __input.len();
15919 let mut payload_buf = [0; Self::ENCODED_LEN];
15920 let mut buf = if avail_len < Self::ENCODED_LEN {
15921 payload_buf[0..avail_len].copy_from_slice(__input);
15922 Bytes::new(&payload_buf)
15923 } else {
15924 Bytes::new(__input)
15925 };
15926 let mut __struct = Self::default();
15927 __struct.time_usec = buf.get_u64_le();
15928 for v in &mut __struct.attitude_quaternion {
15929 let val = buf.get_f32_le();
15930 *v = val;
15931 }
15932 __struct.rollspeed = buf.get_f32_le();
15933 __struct.pitchspeed = buf.get_f32_le();
15934 __struct.yawspeed = buf.get_f32_le();
15935 __struct.lat = buf.get_i32_le();
15936 __struct.lon = buf.get_i32_le();
15937 __struct.alt = buf.get_i32_le();
15938 __struct.vx = buf.get_i16_le();
15939 __struct.vy = buf.get_i16_le();
15940 __struct.vz = buf.get_i16_le();
15941 __struct.ind_airspeed = buf.get_u16_le();
15942 __struct.true_airspeed = buf.get_u16_le();
15943 __struct.xacc = buf.get_i16_le();
15944 __struct.yacc = buf.get_i16_le();
15945 __struct.zacc = buf.get_i16_le();
15946 Ok(__struct)
15947 }
15948 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15949 let mut __tmp = BytesMut::new(bytes);
15950 #[allow(clippy::absurd_extreme_comparisons)]
15951 #[allow(unused_comparisons)]
15952 if __tmp.remaining() < Self::ENCODED_LEN {
15953 panic!(
15954 "buffer is too small (need {} bytes, but got {})",
15955 Self::ENCODED_LEN,
15956 __tmp.remaining(),
15957 )
15958 }
15959 __tmp.put_u64_le(self.time_usec);
15960 for val in &self.attitude_quaternion {
15961 __tmp.put_f32_le(*val);
15962 }
15963 __tmp.put_f32_le(self.rollspeed);
15964 __tmp.put_f32_le(self.pitchspeed);
15965 __tmp.put_f32_le(self.yawspeed);
15966 __tmp.put_i32_le(self.lat);
15967 __tmp.put_i32_le(self.lon);
15968 __tmp.put_i32_le(self.alt);
15969 __tmp.put_i16_le(self.vx);
15970 __tmp.put_i16_le(self.vy);
15971 __tmp.put_i16_le(self.vz);
15972 __tmp.put_u16_le(self.ind_airspeed);
15973 __tmp.put_u16_le(self.true_airspeed);
15974 __tmp.put_i16_le(self.xacc);
15975 __tmp.put_i16_le(self.yacc);
15976 __tmp.put_i16_le(self.zacc);
15977 if matches!(version, MavlinkVersion::V2) {
15978 let len = __tmp.len();
15979 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15980 } else {
15981 __tmp.len()
15982 }
15983 }
15984}
15985#[doc = "id: 242"]
15986#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
15987#[derive(Debug, Clone, PartialEq)]
15988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15990pub struct HOME_POSITION_DATA {
15991 #[doc = "Latitude (WGS84)"]
15992 pub latitude: i32,
15993 #[doc = "Longitude (WGS84)"]
15994 pub longitude: i32,
15995 #[doc = "Altitude (MSL). Positive for up."]
15996 pub altitude: i32,
15997 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
15998 pub x: f32,
15999 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16000 pub y: f32,
16001 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16002 pub z: f32,
16003 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16004 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16005 pub q: [f32; 4],
16006 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16007 pub approach_x: f32,
16008 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16009 pub approach_y: f32,
16010 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16011 pub approach_z: f32,
16012 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16013 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16014 pub time_usec: u64,
16015}
16016impl HOME_POSITION_DATA {
16017 pub const ENCODED_LEN: usize = 60usize;
16018 pub const DEFAULT: Self = Self {
16019 latitude: 0_i32,
16020 longitude: 0_i32,
16021 altitude: 0_i32,
16022 x: 0.0_f32,
16023 y: 0.0_f32,
16024 z: 0.0_f32,
16025 q: [0.0_f32; 4usize],
16026 approach_x: 0.0_f32,
16027 approach_y: 0.0_f32,
16028 approach_z: 0.0_f32,
16029 time_usec: 0_u64,
16030 };
16031 #[cfg(feature = "arbitrary")]
16032 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16033 use arbitrary::{Arbitrary, Unstructured};
16034 let mut buf = [0u8; 1024];
16035 rng.fill_bytes(&mut buf);
16036 let mut unstructured = Unstructured::new(&buf);
16037 Self::arbitrary(&mut unstructured).unwrap_or_default()
16038 }
16039}
16040impl Default for HOME_POSITION_DATA {
16041 fn default() -> Self {
16042 Self::DEFAULT.clone()
16043 }
16044}
16045impl MessageData for HOME_POSITION_DATA {
16046 type Message = MavMessage;
16047 const ID: u32 = 242u32;
16048 const NAME: &'static str = "HOME_POSITION";
16049 const EXTRA_CRC: u8 = 104u8;
16050 const ENCODED_LEN: usize = 60usize;
16051 fn deser(
16052 _version: MavlinkVersion,
16053 __input: &[u8],
16054 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16055 let avail_len = __input.len();
16056 let mut payload_buf = [0; Self::ENCODED_LEN];
16057 let mut buf = if avail_len < Self::ENCODED_LEN {
16058 payload_buf[0..avail_len].copy_from_slice(__input);
16059 Bytes::new(&payload_buf)
16060 } else {
16061 Bytes::new(__input)
16062 };
16063 let mut __struct = Self::default();
16064 __struct.latitude = buf.get_i32_le();
16065 __struct.longitude = buf.get_i32_le();
16066 __struct.altitude = buf.get_i32_le();
16067 __struct.x = buf.get_f32_le();
16068 __struct.y = buf.get_f32_le();
16069 __struct.z = buf.get_f32_le();
16070 for v in &mut __struct.q {
16071 let val = buf.get_f32_le();
16072 *v = val;
16073 }
16074 __struct.approach_x = buf.get_f32_le();
16075 __struct.approach_y = buf.get_f32_le();
16076 __struct.approach_z = buf.get_f32_le();
16077 __struct.time_usec = buf.get_u64_le();
16078 Ok(__struct)
16079 }
16080 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16081 let mut __tmp = BytesMut::new(bytes);
16082 #[allow(clippy::absurd_extreme_comparisons)]
16083 #[allow(unused_comparisons)]
16084 if __tmp.remaining() < Self::ENCODED_LEN {
16085 panic!(
16086 "buffer is too small (need {} bytes, but got {})",
16087 Self::ENCODED_LEN,
16088 __tmp.remaining(),
16089 )
16090 }
16091 __tmp.put_i32_le(self.latitude);
16092 __tmp.put_i32_le(self.longitude);
16093 __tmp.put_i32_le(self.altitude);
16094 __tmp.put_f32_le(self.x);
16095 __tmp.put_f32_le(self.y);
16096 __tmp.put_f32_le(self.z);
16097 for val in &self.q {
16098 __tmp.put_f32_le(*val);
16099 }
16100 __tmp.put_f32_le(self.approach_x);
16101 __tmp.put_f32_le(self.approach_y);
16102 __tmp.put_f32_le(self.approach_z);
16103 __tmp.put_u64_le(self.time_usec);
16104 if matches!(version, MavlinkVersion::V2) {
16105 let len = __tmp.len();
16106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16107 } else {
16108 __tmp.len()
16109 }
16110 }
16111}
16112#[doc = "id: 12920"]
16113#[doc = "Temperature and humidity from hygrometer."]
16114#[derive(Debug, Clone, PartialEq)]
16115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16117pub struct HYGROMETER_SENSOR_DATA {
16118 #[doc = "Temperature"]
16119 pub temperature: i16,
16120 #[doc = "Humidity"]
16121 pub humidity: u16,
16122 #[doc = "Hygrometer ID"]
16123 pub id: u8,
16124}
16125impl HYGROMETER_SENSOR_DATA {
16126 pub const ENCODED_LEN: usize = 5usize;
16127 pub const DEFAULT: Self = Self {
16128 temperature: 0_i16,
16129 humidity: 0_u16,
16130 id: 0_u8,
16131 };
16132 #[cfg(feature = "arbitrary")]
16133 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16134 use arbitrary::{Arbitrary, Unstructured};
16135 let mut buf = [0u8; 1024];
16136 rng.fill_bytes(&mut buf);
16137 let mut unstructured = Unstructured::new(&buf);
16138 Self::arbitrary(&mut unstructured).unwrap_or_default()
16139 }
16140}
16141impl Default for HYGROMETER_SENSOR_DATA {
16142 fn default() -> Self {
16143 Self::DEFAULT.clone()
16144 }
16145}
16146impl MessageData for HYGROMETER_SENSOR_DATA {
16147 type Message = MavMessage;
16148 const ID: u32 = 12920u32;
16149 const NAME: &'static str = "HYGROMETER_SENSOR";
16150 const EXTRA_CRC: u8 = 20u8;
16151 const ENCODED_LEN: usize = 5usize;
16152 fn deser(
16153 _version: MavlinkVersion,
16154 __input: &[u8],
16155 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16156 let avail_len = __input.len();
16157 let mut payload_buf = [0; Self::ENCODED_LEN];
16158 let mut buf = if avail_len < Self::ENCODED_LEN {
16159 payload_buf[0..avail_len].copy_from_slice(__input);
16160 Bytes::new(&payload_buf)
16161 } else {
16162 Bytes::new(__input)
16163 };
16164 let mut __struct = Self::default();
16165 __struct.temperature = buf.get_i16_le();
16166 __struct.humidity = buf.get_u16_le();
16167 __struct.id = buf.get_u8();
16168 Ok(__struct)
16169 }
16170 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16171 let mut __tmp = BytesMut::new(bytes);
16172 #[allow(clippy::absurd_extreme_comparisons)]
16173 #[allow(unused_comparisons)]
16174 if __tmp.remaining() < Self::ENCODED_LEN {
16175 panic!(
16176 "buffer is too small (need {} bytes, but got {})",
16177 Self::ENCODED_LEN,
16178 __tmp.remaining(),
16179 )
16180 }
16181 __tmp.put_i16_le(self.temperature);
16182 __tmp.put_u16_le(self.humidity);
16183 __tmp.put_u8(self.id);
16184 if matches!(version, MavlinkVersion::V2) {
16185 let len = __tmp.len();
16186 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16187 } else {
16188 __tmp.len()
16189 }
16190 }
16191}
16192#[doc = "id: 440"]
16193#[doc = "Illuminator status."]
16194#[derive(Debug, Clone, PartialEq)]
16195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16196#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16197pub struct ILLUMINATOR_STATUS_DATA {
16198 #[doc = "Time since the start-up of the illuminator in ms"]
16199 pub uptime_ms: u32,
16200 #[doc = "Errors"]
16201 pub error_status: IlluminatorErrorFlags,
16202 #[doc = "Illuminator brightness"]
16203 pub brightness: f32,
16204 #[doc = "Illuminator strobing period in seconds"]
16205 pub strobe_period: f32,
16206 #[doc = "Illuminator strobing duty cycle"]
16207 pub strobe_duty_cycle: f32,
16208 #[doc = "Temperature in Celsius"]
16209 pub temp_c: f32,
16210 #[doc = "Minimum strobing period in seconds"]
16211 pub min_strobe_period: f32,
16212 #[doc = "Maximum strobing period in seconds"]
16213 pub max_strobe_period: f32,
16214 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16215 pub enable: u8,
16216 #[doc = "Supported illuminator modes"]
16217 pub mode_bitmask: IlluminatorMode,
16218 #[doc = "Illuminator mode"]
16219 pub mode: IlluminatorMode,
16220}
16221impl ILLUMINATOR_STATUS_DATA {
16222 pub const ENCODED_LEN: usize = 35usize;
16223 pub const DEFAULT: Self = Self {
16224 uptime_ms: 0_u32,
16225 error_status: IlluminatorErrorFlags::DEFAULT,
16226 brightness: 0.0_f32,
16227 strobe_period: 0.0_f32,
16228 strobe_duty_cycle: 0.0_f32,
16229 temp_c: 0.0_f32,
16230 min_strobe_period: 0.0_f32,
16231 max_strobe_period: 0.0_f32,
16232 enable: 0_u8,
16233 mode_bitmask: IlluminatorMode::DEFAULT,
16234 mode: IlluminatorMode::DEFAULT,
16235 };
16236 #[cfg(feature = "arbitrary")]
16237 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16238 use arbitrary::{Arbitrary, Unstructured};
16239 let mut buf = [0u8; 1024];
16240 rng.fill_bytes(&mut buf);
16241 let mut unstructured = Unstructured::new(&buf);
16242 Self::arbitrary(&mut unstructured).unwrap_or_default()
16243 }
16244}
16245impl Default for ILLUMINATOR_STATUS_DATA {
16246 fn default() -> Self {
16247 Self::DEFAULT.clone()
16248 }
16249}
16250impl MessageData for ILLUMINATOR_STATUS_DATA {
16251 type Message = MavMessage;
16252 const ID: u32 = 440u32;
16253 const NAME: &'static str = "ILLUMINATOR_STATUS";
16254 const EXTRA_CRC: u8 = 66u8;
16255 const ENCODED_LEN: usize = 35usize;
16256 fn deser(
16257 _version: MavlinkVersion,
16258 __input: &[u8],
16259 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16260 let avail_len = __input.len();
16261 let mut payload_buf = [0; Self::ENCODED_LEN];
16262 let mut buf = if avail_len < Self::ENCODED_LEN {
16263 payload_buf[0..avail_len].copy_from_slice(__input);
16264 Bytes::new(&payload_buf)
16265 } else {
16266 Bytes::new(__input)
16267 };
16268 let mut __struct = Self::default();
16269 __struct.uptime_ms = buf.get_u32_le();
16270 let tmp = buf.get_u32_le();
16271 __struct.error_status = IlluminatorErrorFlags::from_bits(
16272 tmp & IlluminatorErrorFlags::all().bits(),
16273 )
16274 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16275 flag_type: "IlluminatorErrorFlags",
16276 value: tmp as u32,
16277 })?;
16278 __struct.brightness = buf.get_f32_le();
16279 __struct.strobe_period = buf.get_f32_le();
16280 __struct.strobe_duty_cycle = buf.get_f32_le();
16281 __struct.temp_c = buf.get_f32_le();
16282 __struct.min_strobe_period = buf.get_f32_le();
16283 __struct.max_strobe_period = buf.get_f32_le();
16284 __struct.enable = buf.get_u8();
16285 let tmp = buf.get_u8();
16286 __struct.mode_bitmask =
16287 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16288 enum_type: "IlluminatorMode",
16289 value: tmp as u32,
16290 })?;
16291 let tmp = buf.get_u8();
16292 __struct.mode =
16293 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16294 enum_type: "IlluminatorMode",
16295 value: tmp as u32,
16296 })?;
16297 Ok(__struct)
16298 }
16299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16300 let mut __tmp = BytesMut::new(bytes);
16301 #[allow(clippy::absurd_extreme_comparisons)]
16302 #[allow(unused_comparisons)]
16303 if __tmp.remaining() < Self::ENCODED_LEN {
16304 panic!(
16305 "buffer is too small (need {} bytes, but got {})",
16306 Self::ENCODED_LEN,
16307 __tmp.remaining(),
16308 )
16309 }
16310 __tmp.put_u32_le(self.uptime_ms);
16311 __tmp.put_u32_le(self.error_status.bits());
16312 __tmp.put_f32_le(self.brightness);
16313 __tmp.put_f32_le(self.strobe_period);
16314 __tmp.put_f32_le(self.strobe_duty_cycle);
16315 __tmp.put_f32_le(self.temp_c);
16316 __tmp.put_f32_le(self.min_strobe_period);
16317 __tmp.put_f32_le(self.max_strobe_period);
16318 __tmp.put_u8(self.enable);
16319 __tmp.put_u8(self.mode_bitmask as u8);
16320 __tmp.put_u8(self.mode as u8);
16321 if matches!(version, MavlinkVersion::V2) {
16322 let len = __tmp.len();
16323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16324 } else {
16325 __tmp.len()
16326 }
16327 }
16328}
16329#[doc = "id: 335"]
16330#[doc = "Status of the Iridium SBD link."]
16331#[derive(Debug, Clone, PartialEq)]
16332#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16334pub struct ISBD_LINK_STATUS_DATA {
16335 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16336 pub timestamp: u64,
16337 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16338 pub last_heartbeat: u64,
16339 #[doc = "Number of failed SBD sessions."]
16340 pub failed_sessions: u16,
16341 #[doc = "Number of successful SBD sessions."]
16342 pub successful_sessions: u16,
16343 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
16344 pub signal_quality: u8,
16345 #[doc = "1: Ring call pending, 0: No call pending."]
16346 pub ring_pending: u8,
16347 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
16348 pub tx_session_pending: u8,
16349 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
16350 pub rx_session_pending: u8,
16351}
16352impl ISBD_LINK_STATUS_DATA {
16353 pub const ENCODED_LEN: usize = 24usize;
16354 pub const DEFAULT: Self = Self {
16355 timestamp: 0_u64,
16356 last_heartbeat: 0_u64,
16357 failed_sessions: 0_u16,
16358 successful_sessions: 0_u16,
16359 signal_quality: 0_u8,
16360 ring_pending: 0_u8,
16361 tx_session_pending: 0_u8,
16362 rx_session_pending: 0_u8,
16363 };
16364 #[cfg(feature = "arbitrary")]
16365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16366 use arbitrary::{Arbitrary, Unstructured};
16367 let mut buf = [0u8; 1024];
16368 rng.fill_bytes(&mut buf);
16369 let mut unstructured = Unstructured::new(&buf);
16370 Self::arbitrary(&mut unstructured).unwrap_or_default()
16371 }
16372}
16373impl Default for ISBD_LINK_STATUS_DATA {
16374 fn default() -> Self {
16375 Self::DEFAULT.clone()
16376 }
16377}
16378impl MessageData for ISBD_LINK_STATUS_DATA {
16379 type Message = MavMessage;
16380 const ID: u32 = 335u32;
16381 const NAME: &'static str = "ISBD_LINK_STATUS";
16382 const EXTRA_CRC: u8 = 225u8;
16383 const ENCODED_LEN: usize = 24usize;
16384 fn deser(
16385 _version: MavlinkVersion,
16386 __input: &[u8],
16387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16388 let avail_len = __input.len();
16389 let mut payload_buf = [0; Self::ENCODED_LEN];
16390 let mut buf = if avail_len < Self::ENCODED_LEN {
16391 payload_buf[0..avail_len].copy_from_slice(__input);
16392 Bytes::new(&payload_buf)
16393 } else {
16394 Bytes::new(__input)
16395 };
16396 let mut __struct = Self::default();
16397 __struct.timestamp = buf.get_u64_le();
16398 __struct.last_heartbeat = buf.get_u64_le();
16399 __struct.failed_sessions = buf.get_u16_le();
16400 __struct.successful_sessions = buf.get_u16_le();
16401 __struct.signal_quality = buf.get_u8();
16402 __struct.ring_pending = buf.get_u8();
16403 __struct.tx_session_pending = buf.get_u8();
16404 __struct.rx_session_pending = buf.get_u8();
16405 Ok(__struct)
16406 }
16407 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16408 let mut __tmp = BytesMut::new(bytes);
16409 #[allow(clippy::absurd_extreme_comparisons)]
16410 #[allow(unused_comparisons)]
16411 if __tmp.remaining() < Self::ENCODED_LEN {
16412 panic!(
16413 "buffer is too small (need {} bytes, but got {})",
16414 Self::ENCODED_LEN,
16415 __tmp.remaining(),
16416 )
16417 }
16418 __tmp.put_u64_le(self.timestamp);
16419 __tmp.put_u64_le(self.last_heartbeat);
16420 __tmp.put_u16_le(self.failed_sessions);
16421 __tmp.put_u16_le(self.successful_sessions);
16422 __tmp.put_u8(self.signal_quality);
16423 __tmp.put_u8(self.ring_pending);
16424 __tmp.put_u8(self.tx_session_pending);
16425 __tmp.put_u8(self.rx_session_pending);
16426 if matches!(version, MavlinkVersion::V2) {
16427 let len = __tmp.len();
16428 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16429 } else {
16430 __tmp.len()
16431 }
16432 }
16433}
16434#[doc = "id: 149"]
16435#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
16436#[derive(Debug, Clone, PartialEq)]
16437#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16438#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16439pub struct LANDING_TARGET_DATA {
16440 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16441 pub time_usec: u64,
16442 #[doc = "X-axis angular offset of the target from the center of the image"]
16443 pub angle_x: f32,
16444 #[doc = "Y-axis angular offset of the target from the center of the image"]
16445 pub angle_y: f32,
16446 #[doc = "Distance to the target from the vehicle"]
16447 pub distance: f32,
16448 #[doc = "Size of target along x-axis"]
16449 pub size_x: f32,
16450 #[doc = "Size of target along y-axis"]
16451 pub size_y: f32,
16452 #[doc = "The ID of the target if multiple targets are present"]
16453 pub target_num: u8,
16454 #[doc = "Coordinate frame used for following fields."]
16455 pub frame: MavFrame,
16456 #[doc = "X Position of the landing target in MAV_FRAME"]
16457 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16458 pub x: f32,
16459 #[doc = "Y Position of the landing target in MAV_FRAME"]
16460 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16461 pub y: f32,
16462 #[doc = "Z Position of the landing target in MAV_FRAME"]
16463 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16464 pub z: f32,
16465 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
16466 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16467 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16468 pub q: [f32; 4],
16469 #[doc = "Type of landing target"]
16470 #[cfg_attr(feature = "serde", serde(default))]
16471 pub mavtype: LandingTargetType,
16472 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
16473 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16474 pub position_valid: u8,
16475}
16476impl LANDING_TARGET_DATA {
16477 pub const ENCODED_LEN: usize = 60usize;
16478 pub const DEFAULT: Self = Self {
16479 time_usec: 0_u64,
16480 angle_x: 0.0_f32,
16481 angle_y: 0.0_f32,
16482 distance: 0.0_f32,
16483 size_x: 0.0_f32,
16484 size_y: 0.0_f32,
16485 target_num: 0_u8,
16486 frame: MavFrame::DEFAULT,
16487 x: 0.0_f32,
16488 y: 0.0_f32,
16489 z: 0.0_f32,
16490 q: [0.0_f32; 4usize],
16491 mavtype: LandingTargetType::DEFAULT,
16492 position_valid: 0_u8,
16493 };
16494 #[cfg(feature = "arbitrary")]
16495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16496 use arbitrary::{Arbitrary, Unstructured};
16497 let mut buf = [0u8; 1024];
16498 rng.fill_bytes(&mut buf);
16499 let mut unstructured = Unstructured::new(&buf);
16500 Self::arbitrary(&mut unstructured).unwrap_or_default()
16501 }
16502}
16503impl Default for LANDING_TARGET_DATA {
16504 fn default() -> Self {
16505 Self::DEFAULT.clone()
16506 }
16507}
16508impl MessageData for LANDING_TARGET_DATA {
16509 type Message = MavMessage;
16510 const ID: u32 = 149u32;
16511 const NAME: &'static str = "LANDING_TARGET";
16512 const EXTRA_CRC: u8 = 200u8;
16513 const ENCODED_LEN: usize = 60usize;
16514 fn deser(
16515 _version: MavlinkVersion,
16516 __input: &[u8],
16517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16518 let avail_len = __input.len();
16519 let mut payload_buf = [0; Self::ENCODED_LEN];
16520 let mut buf = if avail_len < Self::ENCODED_LEN {
16521 payload_buf[0..avail_len].copy_from_slice(__input);
16522 Bytes::new(&payload_buf)
16523 } else {
16524 Bytes::new(__input)
16525 };
16526 let mut __struct = Self::default();
16527 __struct.time_usec = buf.get_u64_le();
16528 __struct.angle_x = buf.get_f32_le();
16529 __struct.angle_y = buf.get_f32_le();
16530 __struct.distance = buf.get_f32_le();
16531 __struct.size_x = buf.get_f32_le();
16532 __struct.size_y = buf.get_f32_le();
16533 __struct.target_num = buf.get_u8();
16534 let tmp = buf.get_u8();
16535 __struct.frame =
16536 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16537 enum_type: "MavFrame",
16538 value: tmp as u32,
16539 })?;
16540 __struct.x = buf.get_f32_le();
16541 __struct.y = buf.get_f32_le();
16542 __struct.z = buf.get_f32_le();
16543 for v in &mut __struct.q {
16544 let val = buf.get_f32_le();
16545 *v = val;
16546 }
16547 let tmp = buf.get_u8();
16548 __struct.mavtype =
16549 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16550 enum_type: "LandingTargetType",
16551 value: tmp as u32,
16552 })?;
16553 __struct.position_valid = buf.get_u8();
16554 Ok(__struct)
16555 }
16556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16557 let mut __tmp = BytesMut::new(bytes);
16558 #[allow(clippy::absurd_extreme_comparisons)]
16559 #[allow(unused_comparisons)]
16560 if __tmp.remaining() < Self::ENCODED_LEN {
16561 panic!(
16562 "buffer is too small (need {} bytes, but got {})",
16563 Self::ENCODED_LEN,
16564 __tmp.remaining(),
16565 )
16566 }
16567 __tmp.put_u64_le(self.time_usec);
16568 __tmp.put_f32_le(self.angle_x);
16569 __tmp.put_f32_le(self.angle_y);
16570 __tmp.put_f32_le(self.distance);
16571 __tmp.put_f32_le(self.size_x);
16572 __tmp.put_f32_le(self.size_y);
16573 __tmp.put_u8(self.target_num);
16574 __tmp.put_u8(self.frame as u8);
16575 __tmp.put_f32_le(self.x);
16576 __tmp.put_f32_le(self.y);
16577 __tmp.put_f32_le(self.z);
16578 for val in &self.q {
16579 __tmp.put_f32_le(*val);
16580 }
16581 __tmp.put_u8(self.mavtype as u8);
16582 __tmp.put_u8(self.position_valid);
16583 if matches!(version, MavlinkVersion::V2) {
16584 let len = __tmp.len();
16585 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16586 } else {
16587 __tmp.len()
16588 }
16589 }
16590}
16591#[doc = "id: 8"]
16592#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
16593#[derive(Debug, Clone, PartialEq)]
16594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16595#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16596pub struct LINK_NODE_STATUS_DATA {
16597 #[doc = "Timestamp (time since system boot)."]
16598 pub timestamp: u64,
16599 #[doc = "Transmit rate"]
16600 pub tx_rate: u32,
16601 #[doc = "Receive rate"]
16602 pub rx_rate: u32,
16603 #[doc = "Messages sent"]
16604 pub messages_sent: u32,
16605 #[doc = "Messages received (estimated from counting seq)"]
16606 pub messages_received: u32,
16607 #[doc = "Messages lost (estimated from counting seq)"]
16608 pub messages_lost: u32,
16609 #[doc = "Number of bytes that could not be parsed correctly."]
16610 pub rx_parse_err: u16,
16611 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16612 pub tx_overflows: u16,
16613 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16614 pub rx_overflows: u16,
16615 #[doc = "Remaining free transmit buffer space"]
16616 pub tx_buf: u8,
16617 #[doc = "Remaining free receive buffer space"]
16618 pub rx_buf: u8,
16619}
16620impl LINK_NODE_STATUS_DATA {
16621 pub const ENCODED_LEN: usize = 36usize;
16622 pub const DEFAULT: Self = Self {
16623 timestamp: 0_u64,
16624 tx_rate: 0_u32,
16625 rx_rate: 0_u32,
16626 messages_sent: 0_u32,
16627 messages_received: 0_u32,
16628 messages_lost: 0_u32,
16629 rx_parse_err: 0_u16,
16630 tx_overflows: 0_u16,
16631 rx_overflows: 0_u16,
16632 tx_buf: 0_u8,
16633 rx_buf: 0_u8,
16634 };
16635 #[cfg(feature = "arbitrary")]
16636 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16637 use arbitrary::{Arbitrary, Unstructured};
16638 let mut buf = [0u8; 1024];
16639 rng.fill_bytes(&mut buf);
16640 let mut unstructured = Unstructured::new(&buf);
16641 Self::arbitrary(&mut unstructured).unwrap_or_default()
16642 }
16643}
16644impl Default for LINK_NODE_STATUS_DATA {
16645 fn default() -> Self {
16646 Self::DEFAULT.clone()
16647 }
16648}
16649impl MessageData for LINK_NODE_STATUS_DATA {
16650 type Message = MavMessage;
16651 const ID: u32 = 8u32;
16652 const NAME: &'static str = "LINK_NODE_STATUS";
16653 const EXTRA_CRC: u8 = 117u8;
16654 const ENCODED_LEN: usize = 36usize;
16655 fn deser(
16656 _version: MavlinkVersion,
16657 __input: &[u8],
16658 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16659 let avail_len = __input.len();
16660 let mut payload_buf = [0; Self::ENCODED_LEN];
16661 let mut buf = if avail_len < Self::ENCODED_LEN {
16662 payload_buf[0..avail_len].copy_from_slice(__input);
16663 Bytes::new(&payload_buf)
16664 } else {
16665 Bytes::new(__input)
16666 };
16667 let mut __struct = Self::default();
16668 __struct.timestamp = buf.get_u64_le();
16669 __struct.tx_rate = buf.get_u32_le();
16670 __struct.rx_rate = buf.get_u32_le();
16671 __struct.messages_sent = buf.get_u32_le();
16672 __struct.messages_received = buf.get_u32_le();
16673 __struct.messages_lost = buf.get_u32_le();
16674 __struct.rx_parse_err = buf.get_u16_le();
16675 __struct.tx_overflows = buf.get_u16_le();
16676 __struct.rx_overflows = buf.get_u16_le();
16677 __struct.tx_buf = buf.get_u8();
16678 __struct.rx_buf = buf.get_u8();
16679 Ok(__struct)
16680 }
16681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16682 let mut __tmp = BytesMut::new(bytes);
16683 #[allow(clippy::absurd_extreme_comparisons)]
16684 #[allow(unused_comparisons)]
16685 if __tmp.remaining() < Self::ENCODED_LEN {
16686 panic!(
16687 "buffer is too small (need {} bytes, but got {})",
16688 Self::ENCODED_LEN,
16689 __tmp.remaining(),
16690 )
16691 }
16692 __tmp.put_u64_le(self.timestamp);
16693 __tmp.put_u32_le(self.tx_rate);
16694 __tmp.put_u32_le(self.rx_rate);
16695 __tmp.put_u32_le(self.messages_sent);
16696 __tmp.put_u32_le(self.messages_received);
16697 __tmp.put_u32_le(self.messages_lost);
16698 __tmp.put_u16_le(self.rx_parse_err);
16699 __tmp.put_u16_le(self.tx_overflows);
16700 __tmp.put_u16_le(self.rx_overflows);
16701 __tmp.put_u8(self.tx_buf);
16702 __tmp.put_u8(self.rx_buf);
16703 if matches!(version, MavlinkVersion::V2) {
16704 let len = __tmp.len();
16705 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16706 } else {
16707 __tmp.len()
16708 }
16709 }
16710}
16711#[doc = "id: 32"]
16712#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16713#[derive(Debug, Clone, PartialEq)]
16714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16715#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16716pub struct LOCAL_POSITION_NED_DATA {
16717 #[doc = "Timestamp (time since system boot)."]
16718 pub time_boot_ms: u32,
16719 #[doc = "X Position"]
16720 pub x: f32,
16721 #[doc = "Y Position"]
16722 pub y: f32,
16723 #[doc = "Z Position"]
16724 pub z: f32,
16725 #[doc = "X Speed"]
16726 pub vx: f32,
16727 #[doc = "Y Speed"]
16728 pub vy: f32,
16729 #[doc = "Z Speed"]
16730 pub vz: f32,
16731}
16732impl LOCAL_POSITION_NED_DATA {
16733 pub const ENCODED_LEN: usize = 28usize;
16734 pub const DEFAULT: Self = Self {
16735 time_boot_ms: 0_u32,
16736 x: 0.0_f32,
16737 y: 0.0_f32,
16738 z: 0.0_f32,
16739 vx: 0.0_f32,
16740 vy: 0.0_f32,
16741 vz: 0.0_f32,
16742 };
16743 #[cfg(feature = "arbitrary")]
16744 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16745 use arbitrary::{Arbitrary, Unstructured};
16746 let mut buf = [0u8; 1024];
16747 rng.fill_bytes(&mut buf);
16748 let mut unstructured = Unstructured::new(&buf);
16749 Self::arbitrary(&mut unstructured).unwrap_or_default()
16750 }
16751}
16752impl Default for LOCAL_POSITION_NED_DATA {
16753 fn default() -> Self {
16754 Self::DEFAULT.clone()
16755 }
16756}
16757impl MessageData for LOCAL_POSITION_NED_DATA {
16758 type Message = MavMessage;
16759 const ID: u32 = 32u32;
16760 const NAME: &'static str = "LOCAL_POSITION_NED";
16761 const EXTRA_CRC: u8 = 185u8;
16762 const ENCODED_LEN: usize = 28usize;
16763 fn deser(
16764 _version: MavlinkVersion,
16765 __input: &[u8],
16766 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16767 let avail_len = __input.len();
16768 let mut payload_buf = [0; Self::ENCODED_LEN];
16769 let mut buf = if avail_len < Self::ENCODED_LEN {
16770 payload_buf[0..avail_len].copy_from_slice(__input);
16771 Bytes::new(&payload_buf)
16772 } else {
16773 Bytes::new(__input)
16774 };
16775 let mut __struct = Self::default();
16776 __struct.time_boot_ms = buf.get_u32_le();
16777 __struct.x = buf.get_f32_le();
16778 __struct.y = buf.get_f32_le();
16779 __struct.z = buf.get_f32_le();
16780 __struct.vx = buf.get_f32_le();
16781 __struct.vy = buf.get_f32_le();
16782 __struct.vz = buf.get_f32_le();
16783 Ok(__struct)
16784 }
16785 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16786 let mut __tmp = BytesMut::new(bytes);
16787 #[allow(clippy::absurd_extreme_comparisons)]
16788 #[allow(unused_comparisons)]
16789 if __tmp.remaining() < Self::ENCODED_LEN {
16790 panic!(
16791 "buffer is too small (need {} bytes, but got {})",
16792 Self::ENCODED_LEN,
16793 __tmp.remaining(),
16794 )
16795 }
16796 __tmp.put_u32_le(self.time_boot_ms);
16797 __tmp.put_f32_le(self.x);
16798 __tmp.put_f32_le(self.y);
16799 __tmp.put_f32_le(self.z);
16800 __tmp.put_f32_le(self.vx);
16801 __tmp.put_f32_le(self.vy);
16802 __tmp.put_f32_le(self.vz);
16803 if matches!(version, MavlinkVersion::V2) {
16804 let len = __tmp.len();
16805 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16806 } else {
16807 __tmp.len()
16808 }
16809 }
16810}
16811#[doc = "id: 64"]
16812#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16813#[derive(Debug, Clone, PartialEq)]
16814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16816pub struct LOCAL_POSITION_NED_COV_DATA {
16817 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16818 pub time_usec: u64,
16819 #[doc = "X Position"]
16820 pub x: f32,
16821 #[doc = "Y Position"]
16822 pub y: f32,
16823 #[doc = "Z Position"]
16824 pub z: f32,
16825 #[doc = "X Speed"]
16826 pub vx: f32,
16827 #[doc = "Y Speed"]
16828 pub vy: f32,
16829 #[doc = "Z Speed"]
16830 pub vz: f32,
16831 #[doc = "X Acceleration"]
16832 pub ax: f32,
16833 #[doc = "Y Acceleration"]
16834 pub ay: f32,
16835 #[doc = "Z Acceleration"]
16836 pub az: f32,
16837 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
16838 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16839 pub covariance: [f32; 45],
16840 #[doc = "Class id of the estimator this estimate originated from."]
16841 pub estimator_type: MavEstimatorType,
16842}
16843impl LOCAL_POSITION_NED_COV_DATA {
16844 pub const ENCODED_LEN: usize = 225usize;
16845 pub const DEFAULT: Self = Self {
16846 time_usec: 0_u64,
16847 x: 0.0_f32,
16848 y: 0.0_f32,
16849 z: 0.0_f32,
16850 vx: 0.0_f32,
16851 vy: 0.0_f32,
16852 vz: 0.0_f32,
16853 ax: 0.0_f32,
16854 ay: 0.0_f32,
16855 az: 0.0_f32,
16856 covariance: [0.0_f32; 45usize],
16857 estimator_type: MavEstimatorType::DEFAULT,
16858 };
16859 #[cfg(feature = "arbitrary")]
16860 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16861 use arbitrary::{Arbitrary, Unstructured};
16862 let mut buf = [0u8; 1024];
16863 rng.fill_bytes(&mut buf);
16864 let mut unstructured = Unstructured::new(&buf);
16865 Self::arbitrary(&mut unstructured).unwrap_or_default()
16866 }
16867}
16868impl Default for LOCAL_POSITION_NED_COV_DATA {
16869 fn default() -> Self {
16870 Self::DEFAULT.clone()
16871 }
16872}
16873impl MessageData for LOCAL_POSITION_NED_COV_DATA {
16874 type Message = MavMessage;
16875 const ID: u32 = 64u32;
16876 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
16877 const EXTRA_CRC: u8 = 191u8;
16878 const ENCODED_LEN: usize = 225usize;
16879 fn deser(
16880 _version: MavlinkVersion,
16881 __input: &[u8],
16882 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16883 let avail_len = __input.len();
16884 let mut payload_buf = [0; Self::ENCODED_LEN];
16885 let mut buf = if avail_len < Self::ENCODED_LEN {
16886 payload_buf[0..avail_len].copy_from_slice(__input);
16887 Bytes::new(&payload_buf)
16888 } else {
16889 Bytes::new(__input)
16890 };
16891 let mut __struct = Self::default();
16892 __struct.time_usec = buf.get_u64_le();
16893 __struct.x = buf.get_f32_le();
16894 __struct.y = buf.get_f32_le();
16895 __struct.z = buf.get_f32_le();
16896 __struct.vx = buf.get_f32_le();
16897 __struct.vy = buf.get_f32_le();
16898 __struct.vz = buf.get_f32_le();
16899 __struct.ax = buf.get_f32_le();
16900 __struct.ay = buf.get_f32_le();
16901 __struct.az = buf.get_f32_le();
16902 for v in &mut __struct.covariance {
16903 let val = buf.get_f32_le();
16904 *v = val;
16905 }
16906 let tmp = buf.get_u8();
16907 __struct.estimator_type =
16908 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16909 enum_type: "MavEstimatorType",
16910 value: tmp as u32,
16911 })?;
16912 Ok(__struct)
16913 }
16914 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16915 let mut __tmp = BytesMut::new(bytes);
16916 #[allow(clippy::absurd_extreme_comparisons)]
16917 #[allow(unused_comparisons)]
16918 if __tmp.remaining() < Self::ENCODED_LEN {
16919 panic!(
16920 "buffer is too small (need {} bytes, but got {})",
16921 Self::ENCODED_LEN,
16922 __tmp.remaining(),
16923 )
16924 }
16925 __tmp.put_u64_le(self.time_usec);
16926 __tmp.put_f32_le(self.x);
16927 __tmp.put_f32_le(self.y);
16928 __tmp.put_f32_le(self.z);
16929 __tmp.put_f32_le(self.vx);
16930 __tmp.put_f32_le(self.vy);
16931 __tmp.put_f32_le(self.vz);
16932 __tmp.put_f32_le(self.ax);
16933 __tmp.put_f32_le(self.ay);
16934 __tmp.put_f32_le(self.az);
16935 for val in &self.covariance {
16936 __tmp.put_f32_le(*val);
16937 }
16938 __tmp.put_u8(self.estimator_type as u8);
16939 if matches!(version, MavlinkVersion::V2) {
16940 let len = __tmp.len();
16941 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16942 } else {
16943 __tmp.len()
16944 }
16945 }
16946}
16947#[doc = "id: 89"]
16948#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16949#[derive(Debug, Clone, PartialEq)]
16950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16952pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
16953 #[doc = "Timestamp (time since system boot)."]
16954 pub time_boot_ms: u32,
16955 #[doc = "X Position"]
16956 pub x: f32,
16957 #[doc = "Y Position"]
16958 pub y: f32,
16959 #[doc = "Z Position"]
16960 pub z: f32,
16961 #[doc = "Roll"]
16962 pub roll: f32,
16963 #[doc = "Pitch"]
16964 pub pitch: f32,
16965 #[doc = "Yaw"]
16966 pub yaw: f32,
16967}
16968impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
16969 pub const ENCODED_LEN: usize = 28usize;
16970 pub const DEFAULT: Self = Self {
16971 time_boot_ms: 0_u32,
16972 x: 0.0_f32,
16973 y: 0.0_f32,
16974 z: 0.0_f32,
16975 roll: 0.0_f32,
16976 pitch: 0.0_f32,
16977 yaw: 0.0_f32,
16978 };
16979 #[cfg(feature = "arbitrary")]
16980 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16981 use arbitrary::{Arbitrary, Unstructured};
16982 let mut buf = [0u8; 1024];
16983 rng.fill_bytes(&mut buf);
16984 let mut unstructured = Unstructured::new(&buf);
16985 Self::arbitrary(&mut unstructured).unwrap_or_default()
16986 }
16987}
16988impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
16989 fn default() -> Self {
16990 Self::DEFAULT.clone()
16991 }
16992}
16993impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
16994 type Message = MavMessage;
16995 const ID: u32 = 89u32;
16996 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
16997 const EXTRA_CRC: u8 = 231u8;
16998 const ENCODED_LEN: usize = 28usize;
16999 fn deser(
17000 _version: MavlinkVersion,
17001 __input: &[u8],
17002 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17003 let avail_len = __input.len();
17004 let mut payload_buf = [0; Self::ENCODED_LEN];
17005 let mut buf = if avail_len < Self::ENCODED_LEN {
17006 payload_buf[0..avail_len].copy_from_slice(__input);
17007 Bytes::new(&payload_buf)
17008 } else {
17009 Bytes::new(__input)
17010 };
17011 let mut __struct = Self::default();
17012 __struct.time_boot_ms = buf.get_u32_le();
17013 __struct.x = buf.get_f32_le();
17014 __struct.y = buf.get_f32_le();
17015 __struct.z = buf.get_f32_le();
17016 __struct.roll = buf.get_f32_le();
17017 __struct.pitch = buf.get_f32_le();
17018 __struct.yaw = buf.get_f32_le();
17019 Ok(__struct)
17020 }
17021 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17022 let mut __tmp = BytesMut::new(bytes);
17023 #[allow(clippy::absurd_extreme_comparisons)]
17024 #[allow(unused_comparisons)]
17025 if __tmp.remaining() < Self::ENCODED_LEN {
17026 panic!(
17027 "buffer is too small (need {} bytes, but got {})",
17028 Self::ENCODED_LEN,
17029 __tmp.remaining(),
17030 )
17031 }
17032 __tmp.put_u32_le(self.time_boot_ms);
17033 __tmp.put_f32_le(self.x);
17034 __tmp.put_f32_le(self.y);
17035 __tmp.put_f32_le(self.z);
17036 __tmp.put_f32_le(self.roll);
17037 __tmp.put_f32_le(self.pitch);
17038 __tmp.put_f32_le(self.yaw);
17039 if matches!(version, MavlinkVersion::V2) {
17040 let len = __tmp.len();
17041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17042 } else {
17043 __tmp.len()
17044 }
17045 }
17046}
17047#[doc = "id: 268"]
17048#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17049#[derive(Debug, Clone, PartialEq)]
17050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17052pub struct LOGGING_ACK_DATA {
17053 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17054 pub sequence: u16,
17055 #[doc = "system ID of the target"]
17056 pub target_system: u8,
17057 #[doc = "component ID of the target"]
17058 pub target_component: u8,
17059}
17060impl LOGGING_ACK_DATA {
17061 pub const ENCODED_LEN: usize = 4usize;
17062 pub const DEFAULT: Self = Self {
17063 sequence: 0_u16,
17064 target_system: 0_u8,
17065 target_component: 0_u8,
17066 };
17067 #[cfg(feature = "arbitrary")]
17068 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17069 use arbitrary::{Arbitrary, Unstructured};
17070 let mut buf = [0u8; 1024];
17071 rng.fill_bytes(&mut buf);
17072 let mut unstructured = Unstructured::new(&buf);
17073 Self::arbitrary(&mut unstructured).unwrap_or_default()
17074 }
17075}
17076impl Default for LOGGING_ACK_DATA {
17077 fn default() -> Self {
17078 Self::DEFAULT.clone()
17079 }
17080}
17081impl MessageData for LOGGING_ACK_DATA {
17082 type Message = MavMessage;
17083 const ID: u32 = 268u32;
17084 const NAME: &'static str = "LOGGING_ACK";
17085 const EXTRA_CRC: u8 = 14u8;
17086 const ENCODED_LEN: usize = 4usize;
17087 fn deser(
17088 _version: MavlinkVersion,
17089 __input: &[u8],
17090 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17091 let avail_len = __input.len();
17092 let mut payload_buf = [0; Self::ENCODED_LEN];
17093 let mut buf = if avail_len < Self::ENCODED_LEN {
17094 payload_buf[0..avail_len].copy_from_slice(__input);
17095 Bytes::new(&payload_buf)
17096 } else {
17097 Bytes::new(__input)
17098 };
17099 let mut __struct = Self::default();
17100 __struct.sequence = buf.get_u16_le();
17101 __struct.target_system = buf.get_u8();
17102 __struct.target_component = buf.get_u8();
17103 Ok(__struct)
17104 }
17105 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17106 let mut __tmp = BytesMut::new(bytes);
17107 #[allow(clippy::absurd_extreme_comparisons)]
17108 #[allow(unused_comparisons)]
17109 if __tmp.remaining() < Self::ENCODED_LEN {
17110 panic!(
17111 "buffer is too small (need {} bytes, but got {})",
17112 Self::ENCODED_LEN,
17113 __tmp.remaining(),
17114 )
17115 }
17116 __tmp.put_u16_le(self.sequence);
17117 __tmp.put_u8(self.target_system);
17118 __tmp.put_u8(self.target_component);
17119 if matches!(version, MavlinkVersion::V2) {
17120 let len = __tmp.len();
17121 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17122 } else {
17123 __tmp.len()
17124 }
17125 }
17126}
17127#[doc = "id: 266"]
17128#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17129#[derive(Debug, Clone, PartialEq)]
17130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17131#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17132pub struct LOGGING_DATA_DATA {
17133 #[doc = "sequence number (can wrap)"]
17134 pub sequence: u16,
17135 #[doc = "system ID of the target"]
17136 pub target_system: u8,
17137 #[doc = "component ID of the target"]
17138 pub target_component: u8,
17139 #[doc = "data length"]
17140 pub length: u8,
17141 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17142 pub first_message_offset: u8,
17143 #[doc = "logged data"]
17144 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17145 pub data: [u8; 249],
17146}
17147impl LOGGING_DATA_DATA {
17148 pub const ENCODED_LEN: usize = 255usize;
17149 pub const DEFAULT: Self = Self {
17150 sequence: 0_u16,
17151 target_system: 0_u8,
17152 target_component: 0_u8,
17153 length: 0_u8,
17154 first_message_offset: 0_u8,
17155 data: [0_u8; 249usize],
17156 };
17157 #[cfg(feature = "arbitrary")]
17158 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17159 use arbitrary::{Arbitrary, Unstructured};
17160 let mut buf = [0u8; 1024];
17161 rng.fill_bytes(&mut buf);
17162 let mut unstructured = Unstructured::new(&buf);
17163 Self::arbitrary(&mut unstructured).unwrap_or_default()
17164 }
17165}
17166impl Default for LOGGING_DATA_DATA {
17167 fn default() -> Self {
17168 Self::DEFAULT.clone()
17169 }
17170}
17171impl MessageData for LOGGING_DATA_DATA {
17172 type Message = MavMessage;
17173 const ID: u32 = 266u32;
17174 const NAME: &'static str = "LOGGING_DATA";
17175 const EXTRA_CRC: u8 = 193u8;
17176 const ENCODED_LEN: usize = 255usize;
17177 fn deser(
17178 _version: MavlinkVersion,
17179 __input: &[u8],
17180 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17181 let avail_len = __input.len();
17182 let mut payload_buf = [0; Self::ENCODED_LEN];
17183 let mut buf = if avail_len < Self::ENCODED_LEN {
17184 payload_buf[0..avail_len].copy_from_slice(__input);
17185 Bytes::new(&payload_buf)
17186 } else {
17187 Bytes::new(__input)
17188 };
17189 let mut __struct = Self::default();
17190 __struct.sequence = buf.get_u16_le();
17191 __struct.target_system = buf.get_u8();
17192 __struct.target_component = buf.get_u8();
17193 __struct.length = buf.get_u8();
17194 __struct.first_message_offset = buf.get_u8();
17195 for v in &mut __struct.data {
17196 let val = buf.get_u8();
17197 *v = val;
17198 }
17199 Ok(__struct)
17200 }
17201 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17202 let mut __tmp = BytesMut::new(bytes);
17203 #[allow(clippy::absurd_extreme_comparisons)]
17204 #[allow(unused_comparisons)]
17205 if __tmp.remaining() < Self::ENCODED_LEN {
17206 panic!(
17207 "buffer is too small (need {} bytes, but got {})",
17208 Self::ENCODED_LEN,
17209 __tmp.remaining(),
17210 )
17211 }
17212 __tmp.put_u16_le(self.sequence);
17213 __tmp.put_u8(self.target_system);
17214 __tmp.put_u8(self.target_component);
17215 __tmp.put_u8(self.length);
17216 __tmp.put_u8(self.first_message_offset);
17217 for val in &self.data {
17218 __tmp.put_u8(*val);
17219 }
17220 if matches!(version, MavlinkVersion::V2) {
17221 let len = __tmp.len();
17222 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17223 } else {
17224 __tmp.len()
17225 }
17226 }
17227}
17228#[doc = "id: 267"]
17229#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17230#[derive(Debug, Clone, PartialEq)]
17231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17233pub struct LOGGING_DATA_ACKED_DATA {
17234 #[doc = "sequence number (can wrap)"]
17235 pub sequence: u16,
17236 #[doc = "system ID of the target"]
17237 pub target_system: u8,
17238 #[doc = "component ID of the target"]
17239 pub target_component: u8,
17240 #[doc = "data length"]
17241 pub length: u8,
17242 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17243 pub first_message_offset: u8,
17244 #[doc = "logged data"]
17245 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17246 pub data: [u8; 249],
17247}
17248impl LOGGING_DATA_ACKED_DATA {
17249 pub const ENCODED_LEN: usize = 255usize;
17250 pub const DEFAULT: Self = Self {
17251 sequence: 0_u16,
17252 target_system: 0_u8,
17253 target_component: 0_u8,
17254 length: 0_u8,
17255 first_message_offset: 0_u8,
17256 data: [0_u8; 249usize],
17257 };
17258 #[cfg(feature = "arbitrary")]
17259 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17260 use arbitrary::{Arbitrary, Unstructured};
17261 let mut buf = [0u8; 1024];
17262 rng.fill_bytes(&mut buf);
17263 let mut unstructured = Unstructured::new(&buf);
17264 Self::arbitrary(&mut unstructured).unwrap_or_default()
17265 }
17266}
17267impl Default for LOGGING_DATA_ACKED_DATA {
17268 fn default() -> Self {
17269 Self::DEFAULT.clone()
17270 }
17271}
17272impl MessageData for LOGGING_DATA_ACKED_DATA {
17273 type Message = MavMessage;
17274 const ID: u32 = 267u32;
17275 const NAME: &'static str = "LOGGING_DATA_ACKED";
17276 const EXTRA_CRC: u8 = 35u8;
17277 const ENCODED_LEN: usize = 255usize;
17278 fn deser(
17279 _version: MavlinkVersion,
17280 __input: &[u8],
17281 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17282 let avail_len = __input.len();
17283 let mut payload_buf = [0; Self::ENCODED_LEN];
17284 let mut buf = if avail_len < Self::ENCODED_LEN {
17285 payload_buf[0..avail_len].copy_from_slice(__input);
17286 Bytes::new(&payload_buf)
17287 } else {
17288 Bytes::new(__input)
17289 };
17290 let mut __struct = Self::default();
17291 __struct.sequence = buf.get_u16_le();
17292 __struct.target_system = buf.get_u8();
17293 __struct.target_component = buf.get_u8();
17294 __struct.length = buf.get_u8();
17295 __struct.first_message_offset = buf.get_u8();
17296 for v in &mut __struct.data {
17297 let val = buf.get_u8();
17298 *v = val;
17299 }
17300 Ok(__struct)
17301 }
17302 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17303 let mut __tmp = BytesMut::new(bytes);
17304 #[allow(clippy::absurd_extreme_comparisons)]
17305 #[allow(unused_comparisons)]
17306 if __tmp.remaining() < Self::ENCODED_LEN {
17307 panic!(
17308 "buffer is too small (need {} bytes, but got {})",
17309 Self::ENCODED_LEN,
17310 __tmp.remaining(),
17311 )
17312 }
17313 __tmp.put_u16_le(self.sequence);
17314 __tmp.put_u8(self.target_system);
17315 __tmp.put_u8(self.target_component);
17316 __tmp.put_u8(self.length);
17317 __tmp.put_u8(self.first_message_offset);
17318 for val in &self.data {
17319 __tmp.put_u8(*val);
17320 }
17321 if matches!(version, MavlinkVersion::V2) {
17322 let len = __tmp.len();
17323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17324 } else {
17325 __tmp.len()
17326 }
17327 }
17328}
17329#[doc = "id: 120"]
17330#[doc = "Reply to LOG_REQUEST_DATA."]
17331#[derive(Debug, Clone, PartialEq)]
17332#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17334pub struct LOG_DATA_DATA {
17335 #[doc = "Offset into the log"]
17336 pub ofs: u32,
17337 #[doc = "Log id (from LOG_ENTRY reply)"]
17338 pub id: u16,
17339 #[doc = "Number of bytes (zero for end of log)"]
17340 pub count: u8,
17341 #[doc = "log data"]
17342 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17343 pub data: [u8; 90],
17344}
17345impl LOG_DATA_DATA {
17346 pub const ENCODED_LEN: usize = 97usize;
17347 pub const DEFAULT: Self = Self {
17348 ofs: 0_u32,
17349 id: 0_u16,
17350 count: 0_u8,
17351 data: [0_u8; 90usize],
17352 };
17353 #[cfg(feature = "arbitrary")]
17354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17355 use arbitrary::{Arbitrary, Unstructured};
17356 let mut buf = [0u8; 1024];
17357 rng.fill_bytes(&mut buf);
17358 let mut unstructured = Unstructured::new(&buf);
17359 Self::arbitrary(&mut unstructured).unwrap_or_default()
17360 }
17361}
17362impl Default for LOG_DATA_DATA {
17363 fn default() -> Self {
17364 Self::DEFAULT.clone()
17365 }
17366}
17367impl MessageData for LOG_DATA_DATA {
17368 type Message = MavMessage;
17369 const ID: u32 = 120u32;
17370 const NAME: &'static str = "LOG_DATA";
17371 const EXTRA_CRC: u8 = 134u8;
17372 const ENCODED_LEN: usize = 97usize;
17373 fn deser(
17374 _version: MavlinkVersion,
17375 __input: &[u8],
17376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17377 let avail_len = __input.len();
17378 let mut payload_buf = [0; Self::ENCODED_LEN];
17379 let mut buf = if avail_len < Self::ENCODED_LEN {
17380 payload_buf[0..avail_len].copy_from_slice(__input);
17381 Bytes::new(&payload_buf)
17382 } else {
17383 Bytes::new(__input)
17384 };
17385 let mut __struct = Self::default();
17386 __struct.ofs = buf.get_u32_le();
17387 __struct.id = buf.get_u16_le();
17388 __struct.count = buf.get_u8();
17389 for v in &mut __struct.data {
17390 let val = buf.get_u8();
17391 *v = val;
17392 }
17393 Ok(__struct)
17394 }
17395 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17396 let mut __tmp = BytesMut::new(bytes);
17397 #[allow(clippy::absurd_extreme_comparisons)]
17398 #[allow(unused_comparisons)]
17399 if __tmp.remaining() < Self::ENCODED_LEN {
17400 panic!(
17401 "buffer is too small (need {} bytes, but got {})",
17402 Self::ENCODED_LEN,
17403 __tmp.remaining(),
17404 )
17405 }
17406 __tmp.put_u32_le(self.ofs);
17407 __tmp.put_u16_le(self.id);
17408 __tmp.put_u8(self.count);
17409 for val in &self.data {
17410 __tmp.put_u8(*val);
17411 }
17412 if matches!(version, MavlinkVersion::V2) {
17413 let len = __tmp.len();
17414 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17415 } else {
17416 __tmp.len()
17417 }
17418 }
17419}
17420#[doc = "id: 118"]
17421#[doc = "Reply to LOG_REQUEST_LIST."]
17422#[derive(Debug, Clone, PartialEq)]
17423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17425pub struct LOG_ENTRY_DATA {
17426 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
17427 pub time_utc: u32,
17428 #[doc = "Size of the log (may be approximate)"]
17429 pub size: u32,
17430 #[doc = "Log id"]
17431 pub id: u16,
17432 #[doc = "Total number of logs"]
17433 pub num_logs: u16,
17434 #[doc = "High log number"]
17435 pub last_log_num: u16,
17436}
17437impl LOG_ENTRY_DATA {
17438 pub const ENCODED_LEN: usize = 14usize;
17439 pub const DEFAULT: Self = Self {
17440 time_utc: 0_u32,
17441 size: 0_u32,
17442 id: 0_u16,
17443 num_logs: 0_u16,
17444 last_log_num: 0_u16,
17445 };
17446 #[cfg(feature = "arbitrary")]
17447 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17448 use arbitrary::{Arbitrary, Unstructured};
17449 let mut buf = [0u8; 1024];
17450 rng.fill_bytes(&mut buf);
17451 let mut unstructured = Unstructured::new(&buf);
17452 Self::arbitrary(&mut unstructured).unwrap_or_default()
17453 }
17454}
17455impl Default for LOG_ENTRY_DATA {
17456 fn default() -> Self {
17457 Self::DEFAULT.clone()
17458 }
17459}
17460impl MessageData for LOG_ENTRY_DATA {
17461 type Message = MavMessage;
17462 const ID: u32 = 118u32;
17463 const NAME: &'static str = "LOG_ENTRY";
17464 const EXTRA_CRC: u8 = 56u8;
17465 const ENCODED_LEN: usize = 14usize;
17466 fn deser(
17467 _version: MavlinkVersion,
17468 __input: &[u8],
17469 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17470 let avail_len = __input.len();
17471 let mut payload_buf = [0; Self::ENCODED_LEN];
17472 let mut buf = if avail_len < Self::ENCODED_LEN {
17473 payload_buf[0..avail_len].copy_from_slice(__input);
17474 Bytes::new(&payload_buf)
17475 } else {
17476 Bytes::new(__input)
17477 };
17478 let mut __struct = Self::default();
17479 __struct.time_utc = buf.get_u32_le();
17480 __struct.size = buf.get_u32_le();
17481 __struct.id = buf.get_u16_le();
17482 __struct.num_logs = buf.get_u16_le();
17483 __struct.last_log_num = buf.get_u16_le();
17484 Ok(__struct)
17485 }
17486 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17487 let mut __tmp = BytesMut::new(bytes);
17488 #[allow(clippy::absurd_extreme_comparisons)]
17489 #[allow(unused_comparisons)]
17490 if __tmp.remaining() < Self::ENCODED_LEN {
17491 panic!(
17492 "buffer is too small (need {} bytes, but got {})",
17493 Self::ENCODED_LEN,
17494 __tmp.remaining(),
17495 )
17496 }
17497 __tmp.put_u32_le(self.time_utc);
17498 __tmp.put_u32_le(self.size);
17499 __tmp.put_u16_le(self.id);
17500 __tmp.put_u16_le(self.num_logs);
17501 __tmp.put_u16_le(self.last_log_num);
17502 if matches!(version, MavlinkVersion::V2) {
17503 let len = __tmp.len();
17504 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17505 } else {
17506 __tmp.len()
17507 }
17508 }
17509}
17510#[doc = "id: 121"]
17511#[doc = "Erase all logs."]
17512#[derive(Debug, Clone, PartialEq)]
17513#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17515pub struct LOG_ERASE_DATA {
17516 #[doc = "System ID"]
17517 pub target_system: u8,
17518 #[doc = "Component ID"]
17519 pub target_component: u8,
17520}
17521impl LOG_ERASE_DATA {
17522 pub const ENCODED_LEN: usize = 2usize;
17523 pub const DEFAULT: Self = Self {
17524 target_system: 0_u8,
17525 target_component: 0_u8,
17526 };
17527 #[cfg(feature = "arbitrary")]
17528 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17529 use arbitrary::{Arbitrary, Unstructured};
17530 let mut buf = [0u8; 1024];
17531 rng.fill_bytes(&mut buf);
17532 let mut unstructured = Unstructured::new(&buf);
17533 Self::arbitrary(&mut unstructured).unwrap_or_default()
17534 }
17535}
17536impl Default for LOG_ERASE_DATA {
17537 fn default() -> Self {
17538 Self::DEFAULT.clone()
17539 }
17540}
17541impl MessageData for LOG_ERASE_DATA {
17542 type Message = MavMessage;
17543 const ID: u32 = 121u32;
17544 const NAME: &'static str = "LOG_ERASE";
17545 const EXTRA_CRC: u8 = 237u8;
17546 const ENCODED_LEN: usize = 2usize;
17547 fn deser(
17548 _version: MavlinkVersion,
17549 __input: &[u8],
17550 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17551 let avail_len = __input.len();
17552 let mut payload_buf = [0; Self::ENCODED_LEN];
17553 let mut buf = if avail_len < Self::ENCODED_LEN {
17554 payload_buf[0..avail_len].copy_from_slice(__input);
17555 Bytes::new(&payload_buf)
17556 } else {
17557 Bytes::new(__input)
17558 };
17559 let mut __struct = Self::default();
17560 __struct.target_system = buf.get_u8();
17561 __struct.target_component = buf.get_u8();
17562 Ok(__struct)
17563 }
17564 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17565 let mut __tmp = BytesMut::new(bytes);
17566 #[allow(clippy::absurd_extreme_comparisons)]
17567 #[allow(unused_comparisons)]
17568 if __tmp.remaining() < Self::ENCODED_LEN {
17569 panic!(
17570 "buffer is too small (need {} bytes, but got {})",
17571 Self::ENCODED_LEN,
17572 __tmp.remaining(),
17573 )
17574 }
17575 __tmp.put_u8(self.target_system);
17576 __tmp.put_u8(self.target_component);
17577 if matches!(version, MavlinkVersion::V2) {
17578 let len = __tmp.len();
17579 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17580 } else {
17581 __tmp.len()
17582 }
17583 }
17584}
17585#[doc = "id: 119"]
17586#[doc = "Request a chunk of a log."]
17587#[derive(Debug, Clone, PartialEq)]
17588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17590pub struct LOG_REQUEST_DATA_DATA {
17591 #[doc = "Offset into the log"]
17592 pub ofs: u32,
17593 #[doc = "Number of bytes"]
17594 pub count: u32,
17595 #[doc = "Log id (from LOG_ENTRY reply)"]
17596 pub id: u16,
17597 #[doc = "System ID"]
17598 pub target_system: u8,
17599 #[doc = "Component ID"]
17600 pub target_component: u8,
17601}
17602impl LOG_REQUEST_DATA_DATA {
17603 pub const ENCODED_LEN: usize = 12usize;
17604 pub const DEFAULT: Self = Self {
17605 ofs: 0_u32,
17606 count: 0_u32,
17607 id: 0_u16,
17608 target_system: 0_u8,
17609 target_component: 0_u8,
17610 };
17611 #[cfg(feature = "arbitrary")]
17612 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17613 use arbitrary::{Arbitrary, Unstructured};
17614 let mut buf = [0u8; 1024];
17615 rng.fill_bytes(&mut buf);
17616 let mut unstructured = Unstructured::new(&buf);
17617 Self::arbitrary(&mut unstructured).unwrap_or_default()
17618 }
17619}
17620impl Default for LOG_REQUEST_DATA_DATA {
17621 fn default() -> Self {
17622 Self::DEFAULT.clone()
17623 }
17624}
17625impl MessageData for LOG_REQUEST_DATA_DATA {
17626 type Message = MavMessage;
17627 const ID: u32 = 119u32;
17628 const NAME: &'static str = "LOG_REQUEST_DATA";
17629 const EXTRA_CRC: u8 = 116u8;
17630 const ENCODED_LEN: usize = 12usize;
17631 fn deser(
17632 _version: MavlinkVersion,
17633 __input: &[u8],
17634 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17635 let avail_len = __input.len();
17636 let mut payload_buf = [0; Self::ENCODED_LEN];
17637 let mut buf = if avail_len < Self::ENCODED_LEN {
17638 payload_buf[0..avail_len].copy_from_slice(__input);
17639 Bytes::new(&payload_buf)
17640 } else {
17641 Bytes::new(__input)
17642 };
17643 let mut __struct = Self::default();
17644 __struct.ofs = buf.get_u32_le();
17645 __struct.count = buf.get_u32_le();
17646 __struct.id = buf.get_u16_le();
17647 __struct.target_system = buf.get_u8();
17648 __struct.target_component = buf.get_u8();
17649 Ok(__struct)
17650 }
17651 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17652 let mut __tmp = BytesMut::new(bytes);
17653 #[allow(clippy::absurd_extreme_comparisons)]
17654 #[allow(unused_comparisons)]
17655 if __tmp.remaining() < Self::ENCODED_LEN {
17656 panic!(
17657 "buffer is too small (need {} bytes, but got {})",
17658 Self::ENCODED_LEN,
17659 __tmp.remaining(),
17660 )
17661 }
17662 __tmp.put_u32_le(self.ofs);
17663 __tmp.put_u32_le(self.count);
17664 __tmp.put_u16_le(self.id);
17665 __tmp.put_u8(self.target_system);
17666 __tmp.put_u8(self.target_component);
17667 if matches!(version, MavlinkVersion::V2) {
17668 let len = __tmp.len();
17669 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17670 } else {
17671 __tmp.len()
17672 }
17673 }
17674}
17675#[doc = "id: 122"]
17676#[doc = "Stop log transfer and resume normal logging."]
17677#[derive(Debug, Clone, PartialEq)]
17678#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17679#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17680pub struct LOG_REQUEST_END_DATA {
17681 #[doc = "System ID"]
17682 pub target_system: u8,
17683 #[doc = "Component ID"]
17684 pub target_component: u8,
17685}
17686impl LOG_REQUEST_END_DATA {
17687 pub const ENCODED_LEN: usize = 2usize;
17688 pub const DEFAULT: Self = Self {
17689 target_system: 0_u8,
17690 target_component: 0_u8,
17691 };
17692 #[cfg(feature = "arbitrary")]
17693 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17694 use arbitrary::{Arbitrary, Unstructured};
17695 let mut buf = [0u8; 1024];
17696 rng.fill_bytes(&mut buf);
17697 let mut unstructured = Unstructured::new(&buf);
17698 Self::arbitrary(&mut unstructured).unwrap_or_default()
17699 }
17700}
17701impl Default for LOG_REQUEST_END_DATA {
17702 fn default() -> Self {
17703 Self::DEFAULT.clone()
17704 }
17705}
17706impl MessageData for LOG_REQUEST_END_DATA {
17707 type Message = MavMessage;
17708 const ID: u32 = 122u32;
17709 const NAME: &'static str = "LOG_REQUEST_END";
17710 const EXTRA_CRC: u8 = 203u8;
17711 const ENCODED_LEN: usize = 2usize;
17712 fn deser(
17713 _version: MavlinkVersion,
17714 __input: &[u8],
17715 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17716 let avail_len = __input.len();
17717 let mut payload_buf = [0; Self::ENCODED_LEN];
17718 let mut buf = if avail_len < Self::ENCODED_LEN {
17719 payload_buf[0..avail_len].copy_from_slice(__input);
17720 Bytes::new(&payload_buf)
17721 } else {
17722 Bytes::new(__input)
17723 };
17724 let mut __struct = Self::default();
17725 __struct.target_system = buf.get_u8();
17726 __struct.target_component = buf.get_u8();
17727 Ok(__struct)
17728 }
17729 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17730 let mut __tmp = BytesMut::new(bytes);
17731 #[allow(clippy::absurd_extreme_comparisons)]
17732 #[allow(unused_comparisons)]
17733 if __tmp.remaining() < Self::ENCODED_LEN {
17734 panic!(
17735 "buffer is too small (need {} bytes, but got {})",
17736 Self::ENCODED_LEN,
17737 __tmp.remaining(),
17738 )
17739 }
17740 __tmp.put_u8(self.target_system);
17741 __tmp.put_u8(self.target_component);
17742 if matches!(version, MavlinkVersion::V2) {
17743 let len = __tmp.len();
17744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17745 } else {
17746 __tmp.len()
17747 }
17748 }
17749}
17750#[doc = "id: 117"]
17751#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
17752#[derive(Debug, Clone, PartialEq)]
17753#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17755pub struct LOG_REQUEST_LIST_DATA {
17756 #[doc = "First log id (0 for first available)"]
17757 pub start: u16,
17758 #[doc = "Last log id (0xffff for last available)"]
17759 pub end: u16,
17760 #[doc = "System ID"]
17761 pub target_system: u8,
17762 #[doc = "Component ID"]
17763 pub target_component: u8,
17764}
17765impl LOG_REQUEST_LIST_DATA {
17766 pub const ENCODED_LEN: usize = 6usize;
17767 pub const DEFAULT: Self = Self {
17768 start: 0_u16,
17769 end: 0_u16,
17770 target_system: 0_u8,
17771 target_component: 0_u8,
17772 };
17773 #[cfg(feature = "arbitrary")]
17774 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17775 use arbitrary::{Arbitrary, Unstructured};
17776 let mut buf = [0u8; 1024];
17777 rng.fill_bytes(&mut buf);
17778 let mut unstructured = Unstructured::new(&buf);
17779 Self::arbitrary(&mut unstructured).unwrap_or_default()
17780 }
17781}
17782impl Default for LOG_REQUEST_LIST_DATA {
17783 fn default() -> Self {
17784 Self::DEFAULT.clone()
17785 }
17786}
17787impl MessageData for LOG_REQUEST_LIST_DATA {
17788 type Message = MavMessage;
17789 const ID: u32 = 117u32;
17790 const NAME: &'static str = "LOG_REQUEST_LIST";
17791 const EXTRA_CRC: u8 = 128u8;
17792 const ENCODED_LEN: usize = 6usize;
17793 fn deser(
17794 _version: MavlinkVersion,
17795 __input: &[u8],
17796 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17797 let avail_len = __input.len();
17798 let mut payload_buf = [0; Self::ENCODED_LEN];
17799 let mut buf = if avail_len < Self::ENCODED_LEN {
17800 payload_buf[0..avail_len].copy_from_slice(__input);
17801 Bytes::new(&payload_buf)
17802 } else {
17803 Bytes::new(__input)
17804 };
17805 let mut __struct = Self::default();
17806 __struct.start = buf.get_u16_le();
17807 __struct.end = buf.get_u16_le();
17808 __struct.target_system = buf.get_u8();
17809 __struct.target_component = buf.get_u8();
17810 Ok(__struct)
17811 }
17812 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17813 let mut __tmp = BytesMut::new(bytes);
17814 #[allow(clippy::absurd_extreme_comparisons)]
17815 #[allow(unused_comparisons)]
17816 if __tmp.remaining() < Self::ENCODED_LEN {
17817 panic!(
17818 "buffer is too small (need {} bytes, but got {})",
17819 Self::ENCODED_LEN,
17820 __tmp.remaining(),
17821 )
17822 }
17823 __tmp.put_u16_le(self.start);
17824 __tmp.put_u16_le(self.end);
17825 __tmp.put_u8(self.target_system);
17826 __tmp.put_u8(self.target_component);
17827 if matches!(version, MavlinkVersion::V2) {
17828 let len = __tmp.len();
17829 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17830 } else {
17831 __tmp.len()
17832 }
17833 }
17834}
17835#[doc = "id: 192"]
17836#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
17837#[derive(Debug, Clone, PartialEq)]
17838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17839#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17840pub struct MAG_CAL_REPORT_DATA {
17841 #[doc = "RMS milligauss residuals."]
17842 pub fitness: f32,
17843 #[doc = "X offset."]
17844 pub ofs_x: f32,
17845 #[doc = "Y offset."]
17846 pub ofs_y: f32,
17847 #[doc = "Z offset."]
17848 pub ofs_z: f32,
17849 #[doc = "X diagonal (matrix 11)."]
17850 pub diag_x: f32,
17851 #[doc = "Y diagonal (matrix 22)."]
17852 pub diag_y: f32,
17853 #[doc = "Z diagonal (matrix 33)."]
17854 pub diag_z: f32,
17855 #[doc = "X off-diagonal (matrix 12 and 21)."]
17856 pub offdiag_x: f32,
17857 #[doc = "Y off-diagonal (matrix 13 and 31)."]
17858 pub offdiag_y: f32,
17859 #[doc = "Z off-diagonal (matrix 32 and 23)."]
17860 pub offdiag_z: f32,
17861 #[doc = "Compass being calibrated."]
17862 pub compass_id: u8,
17863 #[doc = "Bitmask of compasses being calibrated."]
17864 pub cal_mask: u8,
17865 #[doc = "Calibration Status."]
17866 pub cal_status: MagCalStatus,
17867 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
17868 pub autosaved: u8,
17869 #[doc = "Confidence in orientation (higher is better)."]
17870 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17871 pub orientation_confidence: f32,
17872 #[doc = "orientation before calibration."]
17873 #[cfg_attr(feature = "serde", serde(default))]
17874 pub old_orientation: MavSensorOrientation,
17875 #[doc = "orientation after calibration."]
17876 #[cfg_attr(feature = "serde", serde(default))]
17877 pub new_orientation: MavSensorOrientation,
17878 #[doc = "field radius correction factor"]
17879 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17880 pub scale_factor: f32,
17881}
17882impl MAG_CAL_REPORT_DATA {
17883 pub const ENCODED_LEN: usize = 54usize;
17884 pub const DEFAULT: Self = Self {
17885 fitness: 0.0_f32,
17886 ofs_x: 0.0_f32,
17887 ofs_y: 0.0_f32,
17888 ofs_z: 0.0_f32,
17889 diag_x: 0.0_f32,
17890 diag_y: 0.0_f32,
17891 diag_z: 0.0_f32,
17892 offdiag_x: 0.0_f32,
17893 offdiag_y: 0.0_f32,
17894 offdiag_z: 0.0_f32,
17895 compass_id: 0_u8,
17896 cal_mask: 0_u8,
17897 cal_status: MagCalStatus::DEFAULT,
17898 autosaved: 0_u8,
17899 orientation_confidence: 0.0_f32,
17900 old_orientation: MavSensorOrientation::DEFAULT,
17901 new_orientation: MavSensorOrientation::DEFAULT,
17902 scale_factor: 0.0_f32,
17903 };
17904 #[cfg(feature = "arbitrary")]
17905 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17906 use arbitrary::{Arbitrary, Unstructured};
17907 let mut buf = [0u8; 1024];
17908 rng.fill_bytes(&mut buf);
17909 let mut unstructured = Unstructured::new(&buf);
17910 Self::arbitrary(&mut unstructured).unwrap_or_default()
17911 }
17912}
17913impl Default for MAG_CAL_REPORT_DATA {
17914 fn default() -> Self {
17915 Self::DEFAULT.clone()
17916 }
17917}
17918impl MessageData for MAG_CAL_REPORT_DATA {
17919 type Message = MavMessage;
17920 const ID: u32 = 192u32;
17921 const NAME: &'static str = "MAG_CAL_REPORT";
17922 const EXTRA_CRC: u8 = 36u8;
17923 const ENCODED_LEN: usize = 54usize;
17924 fn deser(
17925 _version: MavlinkVersion,
17926 __input: &[u8],
17927 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17928 let avail_len = __input.len();
17929 let mut payload_buf = [0; Self::ENCODED_LEN];
17930 let mut buf = if avail_len < Self::ENCODED_LEN {
17931 payload_buf[0..avail_len].copy_from_slice(__input);
17932 Bytes::new(&payload_buf)
17933 } else {
17934 Bytes::new(__input)
17935 };
17936 let mut __struct = Self::default();
17937 __struct.fitness = buf.get_f32_le();
17938 __struct.ofs_x = buf.get_f32_le();
17939 __struct.ofs_y = buf.get_f32_le();
17940 __struct.ofs_z = buf.get_f32_le();
17941 __struct.diag_x = buf.get_f32_le();
17942 __struct.diag_y = buf.get_f32_le();
17943 __struct.diag_z = buf.get_f32_le();
17944 __struct.offdiag_x = buf.get_f32_le();
17945 __struct.offdiag_y = buf.get_f32_le();
17946 __struct.offdiag_z = buf.get_f32_le();
17947 __struct.compass_id = buf.get_u8();
17948 __struct.cal_mask = buf.get_u8();
17949 let tmp = buf.get_u8();
17950 __struct.cal_status =
17951 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17952 enum_type: "MagCalStatus",
17953 value: tmp as u32,
17954 })?;
17955 __struct.autosaved = buf.get_u8();
17956 __struct.orientation_confidence = buf.get_f32_le();
17957 let tmp = buf.get_u8();
17958 __struct.old_orientation =
17959 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17960 enum_type: "MavSensorOrientation",
17961 value: tmp as u32,
17962 })?;
17963 let tmp = buf.get_u8();
17964 __struct.new_orientation =
17965 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17966 enum_type: "MavSensorOrientation",
17967 value: tmp as u32,
17968 })?;
17969 __struct.scale_factor = buf.get_f32_le();
17970 Ok(__struct)
17971 }
17972 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17973 let mut __tmp = BytesMut::new(bytes);
17974 #[allow(clippy::absurd_extreme_comparisons)]
17975 #[allow(unused_comparisons)]
17976 if __tmp.remaining() < Self::ENCODED_LEN {
17977 panic!(
17978 "buffer is too small (need {} bytes, but got {})",
17979 Self::ENCODED_LEN,
17980 __tmp.remaining(),
17981 )
17982 }
17983 __tmp.put_f32_le(self.fitness);
17984 __tmp.put_f32_le(self.ofs_x);
17985 __tmp.put_f32_le(self.ofs_y);
17986 __tmp.put_f32_le(self.ofs_z);
17987 __tmp.put_f32_le(self.diag_x);
17988 __tmp.put_f32_le(self.diag_y);
17989 __tmp.put_f32_le(self.diag_z);
17990 __tmp.put_f32_le(self.offdiag_x);
17991 __tmp.put_f32_le(self.offdiag_y);
17992 __tmp.put_f32_le(self.offdiag_z);
17993 __tmp.put_u8(self.compass_id);
17994 __tmp.put_u8(self.cal_mask);
17995 __tmp.put_u8(self.cal_status as u8);
17996 __tmp.put_u8(self.autosaved);
17997 __tmp.put_f32_le(self.orientation_confidence);
17998 __tmp.put_u8(self.old_orientation as u8);
17999 __tmp.put_u8(self.new_orientation as u8);
18000 __tmp.put_f32_le(self.scale_factor);
18001 if matches!(version, MavlinkVersion::V2) {
18002 let len = __tmp.len();
18003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18004 } else {
18005 __tmp.len()
18006 }
18007 }
18008}
18009#[doc = "id: 69"]
18010#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18011#[derive(Debug, Clone, PartialEq)]
18012#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18013#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18014pub struct MANUAL_CONTROL_DATA {
18015 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18016 pub x: i16,
18017 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18018 pub y: i16,
18019 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18020 pub z: i16,
18021 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18022 pub r: i16,
18023 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18024 pub buttons: u16,
18025 #[doc = "The system to be controlled."]
18026 pub target: u8,
18027 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18028 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18029 pub buttons2: u16,
18030 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18031 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18032 pub enabled_extensions: u8,
18033 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18034 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18035 pub s: i16,
18036 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18037 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18038 pub t: i16,
18039 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18040 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18041 pub aux1: i16,
18042 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18043 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18044 pub aux2: i16,
18045 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18046 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18047 pub aux3: i16,
18048 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18049 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18050 pub aux4: i16,
18051 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18052 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18053 pub aux5: i16,
18054 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18055 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18056 pub aux6: i16,
18057}
18058impl MANUAL_CONTROL_DATA {
18059 pub const ENCODED_LEN: usize = 30usize;
18060 pub const DEFAULT: Self = Self {
18061 x: 0_i16,
18062 y: 0_i16,
18063 z: 0_i16,
18064 r: 0_i16,
18065 buttons: 0_u16,
18066 target: 0_u8,
18067 buttons2: 0_u16,
18068 enabled_extensions: 0_u8,
18069 s: 0_i16,
18070 t: 0_i16,
18071 aux1: 0_i16,
18072 aux2: 0_i16,
18073 aux3: 0_i16,
18074 aux4: 0_i16,
18075 aux5: 0_i16,
18076 aux6: 0_i16,
18077 };
18078 #[cfg(feature = "arbitrary")]
18079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18080 use arbitrary::{Arbitrary, Unstructured};
18081 let mut buf = [0u8; 1024];
18082 rng.fill_bytes(&mut buf);
18083 let mut unstructured = Unstructured::new(&buf);
18084 Self::arbitrary(&mut unstructured).unwrap_or_default()
18085 }
18086}
18087impl Default for MANUAL_CONTROL_DATA {
18088 fn default() -> Self {
18089 Self::DEFAULT.clone()
18090 }
18091}
18092impl MessageData for MANUAL_CONTROL_DATA {
18093 type Message = MavMessage;
18094 const ID: u32 = 69u32;
18095 const NAME: &'static str = "MANUAL_CONTROL";
18096 const EXTRA_CRC: u8 = 243u8;
18097 const ENCODED_LEN: usize = 30usize;
18098 fn deser(
18099 _version: MavlinkVersion,
18100 __input: &[u8],
18101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18102 let avail_len = __input.len();
18103 let mut payload_buf = [0; Self::ENCODED_LEN];
18104 let mut buf = if avail_len < Self::ENCODED_LEN {
18105 payload_buf[0..avail_len].copy_from_slice(__input);
18106 Bytes::new(&payload_buf)
18107 } else {
18108 Bytes::new(__input)
18109 };
18110 let mut __struct = Self::default();
18111 __struct.x = buf.get_i16_le();
18112 __struct.y = buf.get_i16_le();
18113 __struct.z = buf.get_i16_le();
18114 __struct.r = buf.get_i16_le();
18115 __struct.buttons = buf.get_u16_le();
18116 __struct.target = buf.get_u8();
18117 __struct.buttons2 = buf.get_u16_le();
18118 __struct.enabled_extensions = buf.get_u8();
18119 __struct.s = buf.get_i16_le();
18120 __struct.t = buf.get_i16_le();
18121 __struct.aux1 = buf.get_i16_le();
18122 __struct.aux2 = buf.get_i16_le();
18123 __struct.aux3 = buf.get_i16_le();
18124 __struct.aux4 = buf.get_i16_le();
18125 __struct.aux5 = buf.get_i16_le();
18126 __struct.aux6 = buf.get_i16_le();
18127 Ok(__struct)
18128 }
18129 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18130 let mut __tmp = BytesMut::new(bytes);
18131 #[allow(clippy::absurd_extreme_comparisons)]
18132 #[allow(unused_comparisons)]
18133 if __tmp.remaining() < Self::ENCODED_LEN {
18134 panic!(
18135 "buffer is too small (need {} bytes, but got {})",
18136 Self::ENCODED_LEN,
18137 __tmp.remaining(),
18138 )
18139 }
18140 __tmp.put_i16_le(self.x);
18141 __tmp.put_i16_le(self.y);
18142 __tmp.put_i16_le(self.z);
18143 __tmp.put_i16_le(self.r);
18144 __tmp.put_u16_le(self.buttons);
18145 __tmp.put_u8(self.target);
18146 __tmp.put_u16_le(self.buttons2);
18147 __tmp.put_u8(self.enabled_extensions);
18148 __tmp.put_i16_le(self.s);
18149 __tmp.put_i16_le(self.t);
18150 __tmp.put_i16_le(self.aux1);
18151 __tmp.put_i16_le(self.aux2);
18152 __tmp.put_i16_le(self.aux3);
18153 __tmp.put_i16_le(self.aux4);
18154 __tmp.put_i16_le(self.aux5);
18155 __tmp.put_i16_le(self.aux6);
18156 if matches!(version, MavlinkVersion::V2) {
18157 let len = __tmp.len();
18158 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18159 } else {
18160 __tmp.len()
18161 }
18162 }
18163}
18164#[doc = "id: 81"]
18165#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18166#[derive(Debug, Clone, PartialEq)]
18167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18169pub struct MANUAL_SETPOINT_DATA {
18170 #[doc = "Timestamp (time since system boot)."]
18171 pub time_boot_ms: u32,
18172 #[doc = "Desired roll rate"]
18173 pub roll: f32,
18174 #[doc = "Desired pitch rate"]
18175 pub pitch: f32,
18176 #[doc = "Desired yaw rate"]
18177 pub yaw: f32,
18178 #[doc = "Collective thrust, normalized to 0 .. 1"]
18179 pub thrust: f32,
18180 #[doc = "Flight mode switch position, 0.. 255"]
18181 pub mode_switch: u8,
18182 #[doc = "Override mode switch position, 0.. 255"]
18183 pub manual_override_switch: u8,
18184}
18185impl MANUAL_SETPOINT_DATA {
18186 pub const ENCODED_LEN: usize = 22usize;
18187 pub const DEFAULT: Self = Self {
18188 time_boot_ms: 0_u32,
18189 roll: 0.0_f32,
18190 pitch: 0.0_f32,
18191 yaw: 0.0_f32,
18192 thrust: 0.0_f32,
18193 mode_switch: 0_u8,
18194 manual_override_switch: 0_u8,
18195 };
18196 #[cfg(feature = "arbitrary")]
18197 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18198 use arbitrary::{Arbitrary, Unstructured};
18199 let mut buf = [0u8; 1024];
18200 rng.fill_bytes(&mut buf);
18201 let mut unstructured = Unstructured::new(&buf);
18202 Self::arbitrary(&mut unstructured).unwrap_or_default()
18203 }
18204}
18205impl Default for MANUAL_SETPOINT_DATA {
18206 fn default() -> Self {
18207 Self::DEFAULT.clone()
18208 }
18209}
18210impl MessageData for MANUAL_SETPOINT_DATA {
18211 type Message = MavMessage;
18212 const ID: u32 = 81u32;
18213 const NAME: &'static str = "MANUAL_SETPOINT";
18214 const EXTRA_CRC: u8 = 106u8;
18215 const ENCODED_LEN: usize = 22usize;
18216 fn deser(
18217 _version: MavlinkVersion,
18218 __input: &[u8],
18219 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18220 let avail_len = __input.len();
18221 let mut payload_buf = [0; Self::ENCODED_LEN];
18222 let mut buf = if avail_len < Self::ENCODED_LEN {
18223 payload_buf[0..avail_len].copy_from_slice(__input);
18224 Bytes::new(&payload_buf)
18225 } else {
18226 Bytes::new(__input)
18227 };
18228 let mut __struct = Self::default();
18229 __struct.time_boot_ms = buf.get_u32_le();
18230 __struct.roll = buf.get_f32_le();
18231 __struct.pitch = buf.get_f32_le();
18232 __struct.yaw = buf.get_f32_le();
18233 __struct.thrust = buf.get_f32_le();
18234 __struct.mode_switch = buf.get_u8();
18235 __struct.manual_override_switch = buf.get_u8();
18236 Ok(__struct)
18237 }
18238 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18239 let mut __tmp = BytesMut::new(bytes);
18240 #[allow(clippy::absurd_extreme_comparisons)]
18241 #[allow(unused_comparisons)]
18242 if __tmp.remaining() < Self::ENCODED_LEN {
18243 panic!(
18244 "buffer is too small (need {} bytes, but got {})",
18245 Self::ENCODED_LEN,
18246 __tmp.remaining(),
18247 )
18248 }
18249 __tmp.put_u32_le(self.time_boot_ms);
18250 __tmp.put_f32_le(self.roll);
18251 __tmp.put_f32_le(self.pitch);
18252 __tmp.put_f32_le(self.yaw);
18253 __tmp.put_f32_le(self.thrust);
18254 __tmp.put_u8(self.mode_switch);
18255 __tmp.put_u8(self.manual_override_switch);
18256 if matches!(version, MavlinkVersion::V2) {
18257 let len = __tmp.len();
18258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18259 } else {
18260 __tmp.len()
18261 }
18262 }
18263}
18264#[doc = "id: 249"]
18265#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
18266#[derive(Debug, Clone, PartialEq)]
18267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18269pub struct MEMORY_VECT_DATA {
18270 #[doc = "Starting address of the debug variables"]
18271 pub address: u16,
18272 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
18273 pub ver: u8,
18274 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
18275 pub mavtype: u8,
18276 #[doc = "Memory contents at specified address"]
18277 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18278 pub value: [i8; 32],
18279}
18280impl MEMORY_VECT_DATA {
18281 pub const ENCODED_LEN: usize = 36usize;
18282 pub const DEFAULT: Self = Self {
18283 address: 0_u16,
18284 ver: 0_u8,
18285 mavtype: 0_u8,
18286 value: [0_i8; 32usize],
18287 };
18288 #[cfg(feature = "arbitrary")]
18289 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18290 use arbitrary::{Arbitrary, Unstructured};
18291 let mut buf = [0u8; 1024];
18292 rng.fill_bytes(&mut buf);
18293 let mut unstructured = Unstructured::new(&buf);
18294 Self::arbitrary(&mut unstructured).unwrap_or_default()
18295 }
18296}
18297impl Default for MEMORY_VECT_DATA {
18298 fn default() -> Self {
18299 Self::DEFAULT.clone()
18300 }
18301}
18302impl MessageData for MEMORY_VECT_DATA {
18303 type Message = MavMessage;
18304 const ID: u32 = 249u32;
18305 const NAME: &'static str = "MEMORY_VECT";
18306 const EXTRA_CRC: u8 = 204u8;
18307 const ENCODED_LEN: usize = 36usize;
18308 fn deser(
18309 _version: MavlinkVersion,
18310 __input: &[u8],
18311 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18312 let avail_len = __input.len();
18313 let mut payload_buf = [0; Self::ENCODED_LEN];
18314 let mut buf = if avail_len < Self::ENCODED_LEN {
18315 payload_buf[0..avail_len].copy_from_slice(__input);
18316 Bytes::new(&payload_buf)
18317 } else {
18318 Bytes::new(__input)
18319 };
18320 let mut __struct = Self::default();
18321 __struct.address = buf.get_u16_le();
18322 __struct.ver = buf.get_u8();
18323 __struct.mavtype = buf.get_u8();
18324 for v in &mut __struct.value {
18325 let val = buf.get_i8();
18326 *v = val;
18327 }
18328 Ok(__struct)
18329 }
18330 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18331 let mut __tmp = BytesMut::new(bytes);
18332 #[allow(clippy::absurd_extreme_comparisons)]
18333 #[allow(unused_comparisons)]
18334 if __tmp.remaining() < Self::ENCODED_LEN {
18335 panic!(
18336 "buffer is too small (need {} bytes, but got {})",
18337 Self::ENCODED_LEN,
18338 __tmp.remaining(),
18339 )
18340 }
18341 __tmp.put_u16_le(self.address);
18342 __tmp.put_u8(self.ver);
18343 __tmp.put_u8(self.mavtype);
18344 for val in &self.value {
18345 __tmp.put_i8(*val);
18346 }
18347 if matches!(version, MavlinkVersion::V2) {
18348 let len = __tmp.len();
18349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18350 } else {
18351 __tmp.len()
18352 }
18353 }
18354}
18355#[doc = "id: 244"]
18356#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
18357#[derive(Debug, Clone, PartialEq)]
18358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18360pub struct MESSAGE_INTERVAL_DATA {
18361 #[doc = "0 indicates the interval at which it is sent."]
18362 pub interval_us: i32,
18363 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
18364 pub message_id: u16,
18365}
18366impl MESSAGE_INTERVAL_DATA {
18367 pub const ENCODED_LEN: usize = 6usize;
18368 pub const DEFAULT: Self = Self {
18369 interval_us: 0_i32,
18370 message_id: 0_u16,
18371 };
18372 #[cfg(feature = "arbitrary")]
18373 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18374 use arbitrary::{Arbitrary, Unstructured};
18375 let mut buf = [0u8; 1024];
18376 rng.fill_bytes(&mut buf);
18377 let mut unstructured = Unstructured::new(&buf);
18378 Self::arbitrary(&mut unstructured).unwrap_or_default()
18379 }
18380}
18381impl Default for MESSAGE_INTERVAL_DATA {
18382 fn default() -> Self {
18383 Self::DEFAULT.clone()
18384 }
18385}
18386impl MessageData for MESSAGE_INTERVAL_DATA {
18387 type Message = MavMessage;
18388 const ID: u32 = 244u32;
18389 const NAME: &'static str = "MESSAGE_INTERVAL";
18390 const EXTRA_CRC: u8 = 95u8;
18391 const ENCODED_LEN: usize = 6usize;
18392 fn deser(
18393 _version: MavlinkVersion,
18394 __input: &[u8],
18395 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18396 let avail_len = __input.len();
18397 let mut payload_buf = [0; Self::ENCODED_LEN];
18398 let mut buf = if avail_len < Self::ENCODED_LEN {
18399 payload_buf[0..avail_len].copy_from_slice(__input);
18400 Bytes::new(&payload_buf)
18401 } else {
18402 Bytes::new(__input)
18403 };
18404 let mut __struct = Self::default();
18405 __struct.interval_us = buf.get_i32_le();
18406 __struct.message_id = buf.get_u16_le();
18407 Ok(__struct)
18408 }
18409 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18410 let mut __tmp = BytesMut::new(bytes);
18411 #[allow(clippy::absurd_extreme_comparisons)]
18412 #[allow(unused_comparisons)]
18413 if __tmp.remaining() < Self::ENCODED_LEN {
18414 panic!(
18415 "buffer is too small (need {} bytes, but got {})",
18416 Self::ENCODED_LEN,
18417 __tmp.remaining(),
18418 )
18419 }
18420 __tmp.put_i32_le(self.interval_us);
18421 __tmp.put_u16_le(self.message_id);
18422 if matches!(version, MavlinkVersion::V2) {
18423 let len = __tmp.len();
18424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18425 } else {
18426 __tmp.len()
18427 }
18428 }
18429}
18430#[doc = "id: 47"]
18431#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
18432#[derive(Debug, Clone, PartialEq)]
18433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18435pub struct MISSION_ACK_DATA {
18436 #[doc = "System ID"]
18437 pub target_system: u8,
18438 #[doc = "Component ID"]
18439 pub target_component: u8,
18440 #[doc = "Mission result."]
18441 pub mavtype: MavMissionResult,
18442 #[doc = "Mission type."]
18443 #[cfg_attr(feature = "serde", serde(default))]
18444 pub mission_type: MavMissionType,
18445 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
18446 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18447 pub opaque_id: u32,
18448}
18449impl MISSION_ACK_DATA {
18450 pub const ENCODED_LEN: usize = 8usize;
18451 pub const DEFAULT: Self = Self {
18452 target_system: 0_u8,
18453 target_component: 0_u8,
18454 mavtype: MavMissionResult::DEFAULT,
18455 mission_type: MavMissionType::DEFAULT,
18456 opaque_id: 0_u32,
18457 };
18458 #[cfg(feature = "arbitrary")]
18459 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18460 use arbitrary::{Arbitrary, Unstructured};
18461 let mut buf = [0u8; 1024];
18462 rng.fill_bytes(&mut buf);
18463 let mut unstructured = Unstructured::new(&buf);
18464 Self::arbitrary(&mut unstructured).unwrap_or_default()
18465 }
18466}
18467impl Default for MISSION_ACK_DATA {
18468 fn default() -> Self {
18469 Self::DEFAULT.clone()
18470 }
18471}
18472impl MessageData for MISSION_ACK_DATA {
18473 type Message = MavMessage;
18474 const ID: u32 = 47u32;
18475 const NAME: &'static str = "MISSION_ACK";
18476 const EXTRA_CRC: u8 = 153u8;
18477 const ENCODED_LEN: usize = 8usize;
18478 fn deser(
18479 _version: MavlinkVersion,
18480 __input: &[u8],
18481 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18482 let avail_len = __input.len();
18483 let mut payload_buf = [0; Self::ENCODED_LEN];
18484 let mut buf = if avail_len < Self::ENCODED_LEN {
18485 payload_buf[0..avail_len].copy_from_slice(__input);
18486 Bytes::new(&payload_buf)
18487 } else {
18488 Bytes::new(__input)
18489 };
18490 let mut __struct = Self::default();
18491 __struct.target_system = buf.get_u8();
18492 __struct.target_component = buf.get_u8();
18493 let tmp = buf.get_u8();
18494 __struct.mavtype =
18495 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18496 enum_type: "MavMissionResult",
18497 value: tmp as u32,
18498 })?;
18499 let tmp = buf.get_u8();
18500 __struct.mission_type =
18501 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18502 enum_type: "MavMissionType",
18503 value: tmp as u32,
18504 })?;
18505 __struct.opaque_id = buf.get_u32_le();
18506 Ok(__struct)
18507 }
18508 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18509 let mut __tmp = BytesMut::new(bytes);
18510 #[allow(clippy::absurd_extreme_comparisons)]
18511 #[allow(unused_comparisons)]
18512 if __tmp.remaining() < Self::ENCODED_LEN {
18513 panic!(
18514 "buffer is too small (need {} bytes, but got {})",
18515 Self::ENCODED_LEN,
18516 __tmp.remaining(),
18517 )
18518 }
18519 __tmp.put_u8(self.target_system);
18520 __tmp.put_u8(self.target_component);
18521 __tmp.put_u8(self.mavtype as u8);
18522 __tmp.put_u8(self.mission_type as u8);
18523 __tmp.put_u32_le(self.opaque_id);
18524 if matches!(version, MavlinkVersion::V2) {
18525 let len = __tmp.len();
18526 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18527 } else {
18528 __tmp.len()
18529 }
18530 }
18531}
18532#[doc = "id: 45"]
18533#[doc = "Delete all mission items at once."]
18534#[derive(Debug, Clone, PartialEq)]
18535#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18536#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18537pub struct MISSION_CLEAR_ALL_DATA {
18538 #[doc = "System ID"]
18539 pub target_system: u8,
18540 #[doc = "Component ID"]
18541 pub target_component: u8,
18542 #[doc = "Mission type."]
18543 #[cfg_attr(feature = "serde", serde(default))]
18544 pub mission_type: MavMissionType,
18545}
18546impl MISSION_CLEAR_ALL_DATA {
18547 pub const ENCODED_LEN: usize = 3usize;
18548 pub const DEFAULT: Self = Self {
18549 target_system: 0_u8,
18550 target_component: 0_u8,
18551 mission_type: MavMissionType::DEFAULT,
18552 };
18553 #[cfg(feature = "arbitrary")]
18554 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18555 use arbitrary::{Arbitrary, Unstructured};
18556 let mut buf = [0u8; 1024];
18557 rng.fill_bytes(&mut buf);
18558 let mut unstructured = Unstructured::new(&buf);
18559 Self::arbitrary(&mut unstructured).unwrap_or_default()
18560 }
18561}
18562impl Default for MISSION_CLEAR_ALL_DATA {
18563 fn default() -> Self {
18564 Self::DEFAULT.clone()
18565 }
18566}
18567impl MessageData for MISSION_CLEAR_ALL_DATA {
18568 type Message = MavMessage;
18569 const ID: u32 = 45u32;
18570 const NAME: &'static str = "MISSION_CLEAR_ALL";
18571 const EXTRA_CRC: u8 = 232u8;
18572 const ENCODED_LEN: usize = 3usize;
18573 fn deser(
18574 _version: MavlinkVersion,
18575 __input: &[u8],
18576 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18577 let avail_len = __input.len();
18578 let mut payload_buf = [0; Self::ENCODED_LEN];
18579 let mut buf = if avail_len < Self::ENCODED_LEN {
18580 payload_buf[0..avail_len].copy_from_slice(__input);
18581 Bytes::new(&payload_buf)
18582 } else {
18583 Bytes::new(__input)
18584 };
18585 let mut __struct = Self::default();
18586 __struct.target_system = buf.get_u8();
18587 __struct.target_component = buf.get_u8();
18588 let tmp = buf.get_u8();
18589 __struct.mission_type =
18590 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18591 enum_type: "MavMissionType",
18592 value: tmp as u32,
18593 })?;
18594 Ok(__struct)
18595 }
18596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18597 let mut __tmp = BytesMut::new(bytes);
18598 #[allow(clippy::absurd_extreme_comparisons)]
18599 #[allow(unused_comparisons)]
18600 if __tmp.remaining() < Self::ENCODED_LEN {
18601 panic!(
18602 "buffer is too small (need {} bytes, but got {})",
18603 Self::ENCODED_LEN,
18604 __tmp.remaining(),
18605 )
18606 }
18607 __tmp.put_u8(self.target_system);
18608 __tmp.put_u8(self.target_component);
18609 __tmp.put_u8(self.mission_type as u8);
18610 if matches!(version, MavlinkVersion::V2) {
18611 let len = __tmp.len();
18612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18613 } else {
18614 __tmp.len()
18615 }
18616 }
18617}
18618#[doc = "id: 44"]
18619#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
18620#[derive(Debug, Clone, PartialEq)]
18621#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18623pub struct MISSION_COUNT_DATA {
18624 #[doc = "Number of mission items in the sequence"]
18625 pub count: u16,
18626 #[doc = "System ID"]
18627 pub target_system: u8,
18628 #[doc = "Component ID"]
18629 pub target_component: u8,
18630 #[doc = "Mission type."]
18631 #[cfg_attr(feature = "serde", serde(default))]
18632 pub mission_type: MavMissionType,
18633 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
18634 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18635 pub opaque_id: u32,
18636}
18637impl MISSION_COUNT_DATA {
18638 pub const ENCODED_LEN: usize = 9usize;
18639 pub const DEFAULT: Self = Self {
18640 count: 0_u16,
18641 target_system: 0_u8,
18642 target_component: 0_u8,
18643 mission_type: MavMissionType::DEFAULT,
18644 opaque_id: 0_u32,
18645 };
18646 #[cfg(feature = "arbitrary")]
18647 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18648 use arbitrary::{Arbitrary, Unstructured};
18649 let mut buf = [0u8; 1024];
18650 rng.fill_bytes(&mut buf);
18651 let mut unstructured = Unstructured::new(&buf);
18652 Self::arbitrary(&mut unstructured).unwrap_or_default()
18653 }
18654}
18655impl Default for MISSION_COUNT_DATA {
18656 fn default() -> Self {
18657 Self::DEFAULT.clone()
18658 }
18659}
18660impl MessageData for MISSION_COUNT_DATA {
18661 type Message = MavMessage;
18662 const ID: u32 = 44u32;
18663 const NAME: &'static str = "MISSION_COUNT";
18664 const EXTRA_CRC: u8 = 221u8;
18665 const ENCODED_LEN: usize = 9usize;
18666 fn deser(
18667 _version: MavlinkVersion,
18668 __input: &[u8],
18669 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18670 let avail_len = __input.len();
18671 let mut payload_buf = [0; Self::ENCODED_LEN];
18672 let mut buf = if avail_len < Self::ENCODED_LEN {
18673 payload_buf[0..avail_len].copy_from_slice(__input);
18674 Bytes::new(&payload_buf)
18675 } else {
18676 Bytes::new(__input)
18677 };
18678 let mut __struct = Self::default();
18679 __struct.count = buf.get_u16_le();
18680 __struct.target_system = buf.get_u8();
18681 __struct.target_component = buf.get_u8();
18682 let tmp = buf.get_u8();
18683 __struct.mission_type =
18684 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18685 enum_type: "MavMissionType",
18686 value: tmp as u32,
18687 })?;
18688 __struct.opaque_id = buf.get_u32_le();
18689 Ok(__struct)
18690 }
18691 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18692 let mut __tmp = BytesMut::new(bytes);
18693 #[allow(clippy::absurd_extreme_comparisons)]
18694 #[allow(unused_comparisons)]
18695 if __tmp.remaining() < Self::ENCODED_LEN {
18696 panic!(
18697 "buffer is too small (need {} bytes, but got {})",
18698 Self::ENCODED_LEN,
18699 __tmp.remaining(),
18700 )
18701 }
18702 __tmp.put_u16_le(self.count);
18703 __tmp.put_u8(self.target_system);
18704 __tmp.put_u8(self.target_component);
18705 __tmp.put_u8(self.mission_type as u8);
18706 __tmp.put_u32_le(self.opaque_id);
18707 if matches!(version, MavlinkVersion::V2) {
18708 let len = __tmp.len();
18709 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18710 } else {
18711 __tmp.len()
18712 }
18713 }
18714}
18715#[doc = "id: 42"]
18716#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
18717#[derive(Debug, Clone, PartialEq)]
18718#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18719#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18720pub struct MISSION_CURRENT_DATA {
18721 #[doc = "Sequence"]
18722 pub seq: u16,
18723 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
18724 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18725 pub total: u16,
18726 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
18727 #[cfg_attr(feature = "serde", serde(default))]
18728 pub mission_state: MissionState,
18729 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
18730 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18731 pub mission_mode: u8,
18732 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
18733 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18734 pub mission_id: u32,
18735 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
18736 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18737 pub fence_id: u32,
18738 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
18739 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18740 pub rally_points_id: u32,
18741}
18742impl MISSION_CURRENT_DATA {
18743 pub const ENCODED_LEN: usize = 18usize;
18744 pub const DEFAULT: Self = Self {
18745 seq: 0_u16,
18746 total: 0_u16,
18747 mission_state: MissionState::DEFAULT,
18748 mission_mode: 0_u8,
18749 mission_id: 0_u32,
18750 fence_id: 0_u32,
18751 rally_points_id: 0_u32,
18752 };
18753 #[cfg(feature = "arbitrary")]
18754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18755 use arbitrary::{Arbitrary, Unstructured};
18756 let mut buf = [0u8; 1024];
18757 rng.fill_bytes(&mut buf);
18758 let mut unstructured = Unstructured::new(&buf);
18759 Self::arbitrary(&mut unstructured).unwrap_or_default()
18760 }
18761}
18762impl Default for MISSION_CURRENT_DATA {
18763 fn default() -> Self {
18764 Self::DEFAULT.clone()
18765 }
18766}
18767impl MessageData for MISSION_CURRENT_DATA {
18768 type Message = MavMessage;
18769 const ID: u32 = 42u32;
18770 const NAME: &'static str = "MISSION_CURRENT";
18771 const EXTRA_CRC: u8 = 28u8;
18772 const ENCODED_LEN: usize = 18usize;
18773 fn deser(
18774 _version: MavlinkVersion,
18775 __input: &[u8],
18776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18777 let avail_len = __input.len();
18778 let mut payload_buf = [0; Self::ENCODED_LEN];
18779 let mut buf = if avail_len < Self::ENCODED_LEN {
18780 payload_buf[0..avail_len].copy_from_slice(__input);
18781 Bytes::new(&payload_buf)
18782 } else {
18783 Bytes::new(__input)
18784 };
18785 let mut __struct = Self::default();
18786 __struct.seq = buf.get_u16_le();
18787 __struct.total = buf.get_u16_le();
18788 let tmp = buf.get_u8();
18789 __struct.mission_state =
18790 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18791 enum_type: "MissionState",
18792 value: tmp as u32,
18793 })?;
18794 __struct.mission_mode = buf.get_u8();
18795 __struct.mission_id = buf.get_u32_le();
18796 __struct.fence_id = buf.get_u32_le();
18797 __struct.rally_points_id = buf.get_u32_le();
18798 Ok(__struct)
18799 }
18800 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18801 let mut __tmp = BytesMut::new(bytes);
18802 #[allow(clippy::absurd_extreme_comparisons)]
18803 #[allow(unused_comparisons)]
18804 if __tmp.remaining() < Self::ENCODED_LEN {
18805 panic!(
18806 "buffer is too small (need {} bytes, but got {})",
18807 Self::ENCODED_LEN,
18808 __tmp.remaining(),
18809 )
18810 }
18811 __tmp.put_u16_le(self.seq);
18812 __tmp.put_u16_le(self.total);
18813 __tmp.put_u8(self.mission_state as u8);
18814 __tmp.put_u8(self.mission_mode);
18815 __tmp.put_u32_le(self.mission_id);
18816 __tmp.put_u32_le(self.fence_id);
18817 __tmp.put_u32_le(self.rally_points_id);
18818 if matches!(version, MavlinkVersion::V2) {
18819 let len = __tmp.len();
18820 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18821 } else {
18822 __tmp.len()
18823 }
18824 }
18825}
18826#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
18827#[doc = "id: 39"]
18828#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
18829#[derive(Debug, Clone, PartialEq)]
18830#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18832pub struct MISSION_ITEM_DATA {
18833 #[doc = "PARAM1, see MAV_CMD enum"]
18834 pub param1: f32,
18835 #[doc = "PARAM2, see MAV_CMD enum"]
18836 pub param2: f32,
18837 #[doc = "PARAM3, see MAV_CMD enum"]
18838 pub param3: f32,
18839 #[doc = "PARAM4, see MAV_CMD enum"]
18840 pub param4: f32,
18841 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
18842 pub x: f32,
18843 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
18844 pub y: f32,
18845 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
18846 pub z: f32,
18847 #[doc = "Sequence"]
18848 pub seq: u16,
18849 #[doc = "The scheduled action for the waypoint."]
18850 pub command: MavCmd,
18851 #[doc = "System ID"]
18852 pub target_system: u8,
18853 #[doc = "Component ID"]
18854 pub target_component: u8,
18855 #[doc = "The coordinate system of the waypoint."]
18856 pub frame: MavFrame,
18857 #[doc = "false:0, true:1"]
18858 pub current: u8,
18859 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
18860 pub autocontinue: u8,
18861 #[doc = "Mission type."]
18862 #[cfg_attr(feature = "serde", serde(default))]
18863 pub mission_type: MavMissionType,
18864}
18865impl MISSION_ITEM_DATA {
18866 pub const ENCODED_LEN: usize = 38usize;
18867 pub const DEFAULT: Self = Self {
18868 param1: 0.0_f32,
18869 param2: 0.0_f32,
18870 param3: 0.0_f32,
18871 param4: 0.0_f32,
18872 x: 0.0_f32,
18873 y: 0.0_f32,
18874 z: 0.0_f32,
18875 seq: 0_u16,
18876 command: MavCmd::DEFAULT,
18877 target_system: 0_u8,
18878 target_component: 0_u8,
18879 frame: MavFrame::DEFAULT,
18880 current: 0_u8,
18881 autocontinue: 0_u8,
18882 mission_type: MavMissionType::DEFAULT,
18883 };
18884 #[cfg(feature = "arbitrary")]
18885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18886 use arbitrary::{Arbitrary, Unstructured};
18887 let mut buf = [0u8; 1024];
18888 rng.fill_bytes(&mut buf);
18889 let mut unstructured = Unstructured::new(&buf);
18890 Self::arbitrary(&mut unstructured).unwrap_or_default()
18891 }
18892}
18893impl Default for MISSION_ITEM_DATA {
18894 fn default() -> Self {
18895 Self::DEFAULT.clone()
18896 }
18897}
18898impl MessageData for MISSION_ITEM_DATA {
18899 type Message = MavMessage;
18900 const ID: u32 = 39u32;
18901 const NAME: &'static str = "MISSION_ITEM";
18902 const EXTRA_CRC: u8 = 254u8;
18903 const ENCODED_LEN: usize = 38usize;
18904 fn deser(
18905 _version: MavlinkVersion,
18906 __input: &[u8],
18907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18908 let avail_len = __input.len();
18909 let mut payload_buf = [0; Self::ENCODED_LEN];
18910 let mut buf = if avail_len < Self::ENCODED_LEN {
18911 payload_buf[0..avail_len].copy_from_slice(__input);
18912 Bytes::new(&payload_buf)
18913 } else {
18914 Bytes::new(__input)
18915 };
18916 let mut __struct = Self::default();
18917 __struct.param1 = buf.get_f32_le();
18918 __struct.param2 = buf.get_f32_le();
18919 __struct.param3 = buf.get_f32_le();
18920 __struct.param4 = buf.get_f32_le();
18921 __struct.x = buf.get_f32_le();
18922 __struct.y = buf.get_f32_le();
18923 __struct.z = buf.get_f32_le();
18924 __struct.seq = buf.get_u16_le();
18925 let tmp = buf.get_u16_le();
18926 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
18927 ::mavlink_core::error::ParserError::InvalidEnum {
18928 enum_type: "MavCmd",
18929 value: tmp as u32,
18930 },
18931 )?;
18932 __struct.target_system = buf.get_u8();
18933 __struct.target_component = buf.get_u8();
18934 let tmp = buf.get_u8();
18935 __struct.frame =
18936 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18937 enum_type: "MavFrame",
18938 value: tmp as u32,
18939 })?;
18940 __struct.current = buf.get_u8();
18941 __struct.autocontinue = buf.get_u8();
18942 let tmp = buf.get_u8();
18943 __struct.mission_type =
18944 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18945 enum_type: "MavMissionType",
18946 value: tmp as u32,
18947 })?;
18948 Ok(__struct)
18949 }
18950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18951 let mut __tmp = BytesMut::new(bytes);
18952 #[allow(clippy::absurd_extreme_comparisons)]
18953 #[allow(unused_comparisons)]
18954 if __tmp.remaining() < Self::ENCODED_LEN {
18955 panic!(
18956 "buffer is too small (need {} bytes, but got {})",
18957 Self::ENCODED_LEN,
18958 __tmp.remaining(),
18959 )
18960 }
18961 __tmp.put_f32_le(self.param1);
18962 __tmp.put_f32_le(self.param2);
18963 __tmp.put_f32_le(self.param3);
18964 __tmp.put_f32_le(self.param4);
18965 __tmp.put_f32_le(self.x);
18966 __tmp.put_f32_le(self.y);
18967 __tmp.put_f32_le(self.z);
18968 __tmp.put_u16_le(self.seq);
18969 __tmp.put_u16_le(self.command as u16);
18970 __tmp.put_u8(self.target_system);
18971 __tmp.put_u8(self.target_component);
18972 __tmp.put_u8(self.frame as u8);
18973 __tmp.put_u8(self.current);
18974 __tmp.put_u8(self.autocontinue);
18975 __tmp.put_u8(self.mission_type as u8);
18976 if matches!(version, MavlinkVersion::V2) {
18977 let len = __tmp.len();
18978 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18979 } else {
18980 __tmp.len()
18981 }
18982 }
18983}
18984#[doc = "id: 73"]
18985#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
18986#[derive(Debug, Clone, PartialEq)]
18987#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18988#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18989pub struct MISSION_ITEM_INT_DATA {
18990 #[doc = "PARAM1, see MAV_CMD enum"]
18991 pub param1: f32,
18992 #[doc = "PARAM2, see MAV_CMD enum"]
18993 pub param2: f32,
18994 #[doc = "PARAM3, see MAV_CMD enum"]
18995 pub param3: f32,
18996 #[doc = "PARAM4, see MAV_CMD enum"]
18997 pub param4: f32,
18998 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
18999 pub x: i32,
19000 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19001 pub y: i32,
19002 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19003 pub z: f32,
19004 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19005 pub seq: u16,
19006 #[doc = "The scheduled action for the waypoint."]
19007 pub command: MavCmd,
19008 #[doc = "System ID"]
19009 pub target_system: u8,
19010 #[doc = "Component ID"]
19011 pub target_component: u8,
19012 #[doc = "The coordinate system of the waypoint."]
19013 pub frame: MavFrame,
19014 #[doc = "false:0, true:1"]
19015 pub current: u8,
19016 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19017 pub autocontinue: u8,
19018 #[doc = "Mission type."]
19019 #[cfg_attr(feature = "serde", serde(default))]
19020 pub mission_type: MavMissionType,
19021}
19022impl MISSION_ITEM_INT_DATA {
19023 pub const ENCODED_LEN: usize = 38usize;
19024 pub const DEFAULT: Self = Self {
19025 param1: 0.0_f32,
19026 param2: 0.0_f32,
19027 param3: 0.0_f32,
19028 param4: 0.0_f32,
19029 x: 0_i32,
19030 y: 0_i32,
19031 z: 0.0_f32,
19032 seq: 0_u16,
19033 command: MavCmd::DEFAULT,
19034 target_system: 0_u8,
19035 target_component: 0_u8,
19036 frame: MavFrame::DEFAULT,
19037 current: 0_u8,
19038 autocontinue: 0_u8,
19039 mission_type: MavMissionType::DEFAULT,
19040 };
19041 #[cfg(feature = "arbitrary")]
19042 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19043 use arbitrary::{Arbitrary, Unstructured};
19044 let mut buf = [0u8; 1024];
19045 rng.fill_bytes(&mut buf);
19046 let mut unstructured = Unstructured::new(&buf);
19047 Self::arbitrary(&mut unstructured).unwrap_or_default()
19048 }
19049}
19050impl Default for MISSION_ITEM_INT_DATA {
19051 fn default() -> Self {
19052 Self::DEFAULT.clone()
19053 }
19054}
19055impl MessageData for MISSION_ITEM_INT_DATA {
19056 type Message = MavMessage;
19057 const ID: u32 = 73u32;
19058 const NAME: &'static str = "MISSION_ITEM_INT";
19059 const EXTRA_CRC: u8 = 38u8;
19060 const ENCODED_LEN: usize = 38usize;
19061 fn deser(
19062 _version: MavlinkVersion,
19063 __input: &[u8],
19064 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19065 let avail_len = __input.len();
19066 let mut payload_buf = [0; Self::ENCODED_LEN];
19067 let mut buf = if avail_len < Self::ENCODED_LEN {
19068 payload_buf[0..avail_len].copy_from_slice(__input);
19069 Bytes::new(&payload_buf)
19070 } else {
19071 Bytes::new(__input)
19072 };
19073 let mut __struct = Self::default();
19074 __struct.param1 = buf.get_f32_le();
19075 __struct.param2 = buf.get_f32_le();
19076 __struct.param3 = buf.get_f32_le();
19077 __struct.param4 = buf.get_f32_le();
19078 __struct.x = buf.get_i32_le();
19079 __struct.y = buf.get_i32_le();
19080 __struct.z = buf.get_f32_le();
19081 __struct.seq = buf.get_u16_le();
19082 let tmp = buf.get_u16_le();
19083 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19084 ::mavlink_core::error::ParserError::InvalidEnum {
19085 enum_type: "MavCmd",
19086 value: tmp as u32,
19087 },
19088 )?;
19089 __struct.target_system = buf.get_u8();
19090 __struct.target_component = buf.get_u8();
19091 let tmp = buf.get_u8();
19092 __struct.frame =
19093 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19094 enum_type: "MavFrame",
19095 value: tmp as u32,
19096 })?;
19097 __struct.current = buf.get_u8();
19098 __struct.autocontinue = buf.get_u8();
19099 let tmp = buf.get_u8();
19100 __struct.mission_type =
19101 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19102 enum_type: "MavMissionType",
19103 value: tmp as u32,
19104 })?;
19105 Ok(__struct)
19106 }
19107 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19108 let mut __tmp = BytesMut::new(bytes);
19109 #[allow(clippy::absurd_extreme_comparisons)]
19110 #[allow(unused_comparisons)]
19111 if __tmp.remaining() < Self::ENCODED_LEN {
19112 panic!(
19113 "buffer is too small (need {} bytes, but got {})",
19114 Self::ENCODED_LEN,
19115 __tmp.remaining(),
19116 )
19117 }
19118 __tmp.put_f32_le(self.param1);
19119 __tmp.put_f32_le(self.param2);
19120 __tmp.put_f32_le(self.param3);
19121 __tmp.put_f32_le(self.param4);
19122 __tmp.put_i32_le(self.x);
19123 __tmp.put_i32_le(self.y);
19124 __tmp.put_f32_le(self.z);
19125 __tmp.put_u16_le(self.seq);
19126 __tmp.put_u16_le(self.command as u16);
19127 __tmp.put_u8(self.target_system);
19128 __tmp.put_u8(self.target_component);
19129 __tmp.put_u8(self.frame as u8);
19130 __tmp.put_u8(self.current);
19131 __tmp.put_u8(self.autocontinue);
19132 __tmp.put_u8(self.mission_type as u8);
19133 if matches!(version, MavlinkVersion::V2) {
19134 let len = __tmp.len();
19135 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19136 } else {
19137 __tmp.len()
19138 }
19139 }
19140}
19141#[doc = "id: 46"]
19142#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19143#[derive(Debug, Clone, PartialEq)]
19144#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19145#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19146pub struct MISSION_ITEM_REACHED_DATA {
19147 #[doc = "Sequence"]
19148 pub seq: u16,
19149}
19150impl MISSION_ITEM_REACHED_DATA {
19151 pub const ENCODED_LEN: usize = 2usize;
19152 pub const DEFAULT: Self = Self { seq: 0_u16 };
19153 #[cfg(feature = "arbitrary")]
19154 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19155 use arbitrary::{Arbitrary, Unstructured};
19156 let mut buf = [0u8; 1024];
19157 rng.fill_bytes(&mut buf);
19158 let mut unstructured = Unstructured::new(&buf);
19159 Self::arbitrary(&mut unstructured).unwrap_or_default()
19160 }
19161}
19162impl Default for MISSION_ITEM_REACHED_DATA {
19163 fn default() -> Self {
19164 Self::DEFAULT.clone()
19165 }
19166}
19167impl MessageData for MISSION_ITEM_REACHED_DATA {
19168 type Message = MavMessage;
19169 const ID: u32 = 46u32;
19170 const NAME: &'static str = "MISSION_ITEM_REACHED";
19171 const EXTRA_CRC: u8 = 11u8;
19172 const ENCODED_LEN: usize = 2usize;
19173 fn deser(
19174 _version: MavlinkVersion,
19175 __input: &[u8],
19176 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19177 let avail_len = __input.len();
19178 let mut payload_buf = [0; Self::ENCODED_LEN];
19179 let mut buf = if avail_len < Self::ENCODED_LEN {
19180 payload_buf[0..avail_len].copy_from_slice(__input);
19181 Bytes::new(&payload_buf)
19182 } else {
19183 Bytes::new(__input)
19184 };
19185 let mut __struct = Self::default();
19186 __struct.seq = buf.get_u16_le();
19187 Ok(__struct)
19188 }
19189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19190 let mut __tmp = BytesMut::new(bytes);
19191 #[allow(clippy::absurd_extreme_comparisons)]
19192 #[allow(unused_comparisons)]
19193 if __tmp.remaining() < Self::ENCODED_LEN {
19194 panic!(
19195 "buffer is too small (need {} bytes, but got {})",
19196 Self::ENCODED_LEN,
19197 __tmp.remaining(),
19198 )
19199 }
19200 __tmp.put_u16_le(self.seq);
19201 if matches!(version, MavlinkVersion::V2) {
19202 let len = __tmp.len();
19203 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19204 } else {
19205 __tmp.len()
19206 }
19207 }
19208}
19209#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19210#[doc = "id: 40"]
19211#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19212#[derive(Debug, Clone, PartialEq)]
19213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19214#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19215pub struct MISSION_REQUEST_DATA {
19216 #[doc = "Sequence"]
19217 pub seq: u16,
19218 #[doc = "System ID"]
19219 pub target_system: u8,
19220 #[doc = "Component ID"]
19221 pub target_component: u8,
19222 #[doc = "Mission type."]
19223 #[cfg_attr(feature = "serde", serde(default))]
19224 pub mission_type: MavMissionType,
19225}
19226impl MISSION_REQUEST_DATA {
19227 pub const ENCODED_LEN: usize = 5usize;
19228 pub const DEFAULT: Self = Self {
19229 seq: 0_u16,
19230 target_system: 0_u8,
19231 target_component: 0_u8,
19232 mission_type: MavMissionType::DEFAULT,
19233 };
19234 #[cfg(feature = "arbitrary")]
19235 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19236 use arbitrary::{Arbitrary, Unstructured};
19237 let mut buf = [0u8; 1024];
19238 rng.fill_bytes(&mut buf);
19239 let mut unstructured = Unstructured::new(&buf);
19240 Self::arbitrary(&mut unstructured).unwrap_or_default()
19241 }
19242}
19243impl Default for MISSION_REQUEST_DATA {
19244 fn default() -> Self {
19245 Self::DEFAULT.clone()
19246 }
19247}
19248impl MessageData for MISSION_REQUEST_DATA {
19249 type Message = MavMessage;
19250 const ID: u32 = 40u32;
19251 const NAME: &'static str = "MISSION_REQUEST";
19252 const EXTRA_CRC: u8 = 230u8;
19253 const ENCODED_LEN: usize = 5usize;
19254 fn deser(
19255 _version: MavlinkVersion,
19256 __input: &[u8],
19257 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19258 let avail_len = __input.len();
19259 let mut payload_buf = [0; Self::ENCODED_LEN];
19260 let mut buf = if avail_len < Self::ENCODED_LEN {
19261 payload_buf[0..avail_len].copy_from_slice(__input);
19262 Bytes::new(&payload_buf)
19263 } else {
19264 Bytes::new(__input)
19265 };
19266 let mut __struct = Self::default();
19267 __struct.seq = buf.get_u16_le();
19268 __struct.target_system = buf.get_u8();
19269 __struct.target_component = buf.get_u8();
19270 let tmp = buf.get_u8();
19271 __struct.mission_type =
19272 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19273 enum_type: "MavMissionType",
19274 value: tmp as u32,
19275 })?;
19276 Ok(__struct)
19277 }
19278 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19279 let mut __tmp = BytesMut::new(bytes);
19280 #[allow(clippy::absurd_extreme_comparisons)]
19281 #[allow(unused_comparisons)]
19282 if __tmp.remaining() < Self::ENCODED_LEN {
19283 panic!(
19284 "buffer is too small (need {} bytes, but got {})",
19285 Self::ENCODED_LEN,
19286 __tmp.remaining(),
19287 )
19288 }
19289 __tmp.put_u16_le(self.seq);
19290 __tmp.put_u8(self.target_system);
19291 __tmp.put_u8(self.target_component);
19292 __tmp.put_u8(self.mission_type as u8);
19293 if matches!(version, MavlinkVersion::V2) {
19294 let len = __tmp.len();
19295 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19296 } else {
19297 __tmp.len()
19298 }
19299 }
19300}
19301#[doc = "id: 51"]
19302#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
19303#[derive(Debug, Clone, PartialEq)]
19304#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19306pub struct MISSION_REQUEST_INT_DATA {
19307 #[doc = "Sequence"]
19308 pub seq: u16,
19309 #[doc = "System ID"]
19310 pub target_system: u8,
19311 #[doc = "Component ID"]
19312 pub target_component: u8,
19313 #[doc = "Mission type."]
19314 #[cfg_attr(feature = "serde", serde(default))]
19315 pub mission_type: MavMissionType,
19316}
19317impl MISSION_REQUEST_INT_DATA {
19318 pub const ENCODED_LEN: usize = 5usize;
19319 pub const DEFAULT: Self = Self {
19320 seq: 0_u16,
19321 target_system: 0_u8,
19322 target_component: 0_u8,
19323 mission_type: MavMissionType::DEFAULT,
19324 };
19325 #[cfg(feature = "arbitrary")]
19326 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19327 use arbitrary::{Arbitrary, Unstructured};
19328 let mut buf = [0u8; 1024];
19329 rng.fill_bytes(&mut buf);
19330 let mut unstructured = Unstructured::new(&buf);
19331 Self::arbitrary(&mut unstructured).unwrap_or_default()
19332 }
19333}
19334impl Default for MISSION_REQUEST_INT_DATA {
19335 fn default() -> Self {
19336 Self::DEFAULT.clone()
19337 }
19338}
19339impl MessageData for MISSION_REQUEST_INT_DATA {
19340 type Message = MavMessage;
19341 const ID: u32 = 51u32;
19342 const NAME: &'static str = "MISSION_REQUEST_INT";
19343 const EXTRA_CRC: u8 = 196u8;
19344 const ENCODED_LEN: usize = 5usize;
19345 fn deser(
19346 _version: MavlinkVersion,
19347 __input: &[u8],
19348 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19349 let avail_len = __input.len();
19350 let mut payload_buf = [0; Self::ENCODED_LEN];
19351 let mut buf = if avail_len < Self::ENCODED_LEN {
19352 payload_buf[0..avail_len].copy_from_slice(__input);
19353 Bytes::new(&payload_buf)
19354 } else {
19355 Bytes::new(__input)
19356 };
19357 let mut __struct = Self::default();
19358 __struct.seq = buf.get_u16_le();
19359 __struct.target_system = buf.get_u8();
19360 __struct.target_component = buf.get_u8();
19361 let tmp = buf.get_u8();
19362 __struct.mission_type =
19363 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19364 enum_type: "MavMissionType",
19365 value: tmp as u32,
19366 })?;
19367 Ok(__struct)
19368 }
19369 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19370 let mut __tmp = BytesMut::new(bytes);
19371 #[allow(clippy::absurd_extreme_comparisons)]
19372 #[allow(unused_comparisons)]
19373 if __tmp.remaining() < Self::ENCODED_LEN {
19374 panic!(
19375 "buffer is too small (need {} bytes, but got {})",
19376 Self::ENCODED_LEN,
19377 __tmp.remaining(),
19378 )
19379 }
19380 __tmp.put_u16_le(self.seq);
19381 __tmp.put_u8(self.target_system);
19382 __tmp.put_u8(self.target_component);
19383 __tmp.put_u8(self.mission_type as u8);
19384 if matches!(version, MavlinkVersion::V2) {
19385 let len = __tmp.len();
19386 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19387 } else {
19388 __tmp.len()
19389 }
19390 }
19391}
19392#[doc = "id: 43"]
19393#[doc = "Request the overall list of mission items from the system/component."]
19394#[derive(Debug, Clone, PartialEq)]
19395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19397pub struct MISSION_REQUEST_LIST_DATA {
19398 #[doc = "System ID"]
19399 pub target_system: u8,
19400 #[doc = "Component ID"]
19401 pub target_component: u8,
19402 #[doc = "Mission type."]
19403 #[cfg_attr(feature = "serde", serde(default))]
19404 pub mission_type: MavMissionType,
19405}
19406impl MISSION_REQUEST_LIST_DATA {
19407 pub const ENCODED_LEN: usize = 3usize;
19408 pub const DEFAULT: Self = Self {
19409 target_system: 0_u8,
19410 target_component: 0_u8,
19411 mission_type: MavMissionType::DEFAULT,
19412 };
19413 #[cfg(feature = "arbitrary")]
19414 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19415 use arbitrary::{Arbitrary, Unstructured};
19416 let mut buf = [0u8; 1024];
19417 rng.fill_bytes(&mut buf);
19418 let mut unstructured = Unstructured::new(&buf);
19419 Self::arbitrary(&mut unstructured).unwrap_or_default()
19420 }
19421}
19422impl Default for MISSION_REQUEST_LIST_DATA {
19423 fn default() -> Self {
19424 Self::DEFAULT.clone()
19425 }
19426}
19427impl MessageData for MISSION_REQUEST_LIST_DATA {
19428 type Message = MavMessage;
19429 const ID: u32 = 43u32;
19430 const NAME: &'static str = "MISSION_REQUEST_LIST";
19431 const EXTRA_CRC: u8 = 132u8;
19432 const ENCODED_LEN: usize = 3usize;
19433 fn deser(
19434 _version: MavlinkVersion,
19435 __input: &[u8],
19436 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19437 let avail_len = __input.len();
19438 let mut payload_buf = [0; Self::ENCODED_LEN];
19439 let mut buf = if avail_len < Self::ENCODED_LEN {
19440 payload_buf[0..avail_len].copy_from_slice(__input);
19441 Bytes::new(&payload_buf)
19442 } else {
19443 Bytes::new(__input)
19444 };
19445 let mut __struct = Self::default();
19446 __struct.target_system = buf.get_u8();
19447 __struct.target_component = buf.get_u8();
19448 let tmp = buf.get_u8();
19449 __struct.mission_type =
19450 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19451 enum_type: "MavMissionType",
19452 value: tmp as u32,
19453 })?;
19454 Ok(__struct)
19455 }
19456 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19457 let mut __tmp = BytesMut::new(bytes);
19458 #[allow(clippy::absurd_extreme_comparisons)]
19459 #[allow(unused_comparisons)]
19460 if __tmp.remaining() < Self::ENCODED_LEN {
19461 panic!(
19462 "buffer is too small (need {} bytes, but got {})",
19463 Self::ENCODED_LEN,
19464 __tmp.remaining(),
19465 )
19466 }
19467 __tmp.put_u8(self.target_system);
19468 __tmp.put_u8(self.target_component);
19469 __tmp.put_u8(self.mission_type as u8);
19470 if matches!(version, MavlinkVersion::V2) {
19471 let len = __tmp.len();
19472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19473 } else {
19474 __tmp.len()
19475 }
19476 }
19477}
19478#[doc = "id: 37"]
19479#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
19480#[derive(Debug, Clone, PartialEq)]
19481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19483pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
19484 #[doc = "Start index"]
19485 pub start_index: i16,
19486 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
19487 pub end_index: i16,
19488 #[doc = "System ID"]
19489 pub target_system: u8,
19490 #[doc = "Component ID"]
19491 pub target_component: u8,
19492 #[doc = "Mission type."]
19493 #[cfg_attr(feature = "serde", serde(default))]
19494 pub mission_type: MavMissionType,
19495}
19496impl MISSION_REQUEST_PARTIAL_LIST_DATA {
19497 pub const ENCODED_LEN: usize = 7usize;
19498 pub const DEFAULT: Self = Self {
19499 start_index: 0_i16,
19500 end_index: 0_i16,
19501 target_system: 0_u8,
19502 target_component: 0_u8,
19503 mission_type: MavMissionType::DEFAULT,
19504 };
19505 #[cfg(feature = "arbitrary")]
19506 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19507 use arbitrary::{Arbitrary, Unstructured};
19508 let mut buf = [0u8; 1024];
19509 rng.fill_bytes(&mut buf);
19510 let mut unstructured = Unstructured::new(&buf);
19511 Self::arbitrary(&mut unstructured).unwrap_or_default()
19512 }
19513}
19514impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
19515 fn default() -> Self {
19516 Self::DEFAULT.clone()
19517 }
19518}
19519impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
19520 type Message = MavMessage;
19521 const ID: u32 = 37u32;
19522 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
19523 const EXTRA_CRC: u8 = 212u8;
19524 const ENCODED_LEN: usize = 7usize;
19525 fn deser(
19526 _version: MavlinkVersion,
19527 __input: &[u8],
19528 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19529 let avail_len = __input.len();
19530 let mut payload_buf = [0; Self::ENCODED_LEN];
19531 let mut buf = if avail_len < Self::ENCODED_LEN {
19532 payload_buf[0..avail_len].copy_from_slice(__input);
19533 Bytes::new(&payload_buf)
19534 } else {
19535 Bytes::new(__input)
19536 };
19537 let mut __struct = Self::default();
19538 __struct.start_index = buf.get_i16_le();
19539 __struct.end_index = buf.get_i16_le();
19540 __struct.target_system = buf.get_u8();
19541 __struct.target_component = buf.get_u8();
19542 let tmp = buf.get_u8();
19543 __struct.mission_type =
19544 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19545 enum_type: "MavMissionType",
19546 value: tmp as u32,
19547 })?;
19548 Ok(__struct)
19549 }
19550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19551 let mut __tmp = BytesMut::new(bytes);
19552 #[allow(clippy::absurd_extreme_comparisons)]
19553 #[allow(unused_comparisons)]
19554 if __tmp.remaining() < Self::ENCODED_LEN {
19555 panic!(
19556 "buffer is too small (need {} bytes, but got {})",
19557 Self::ENCODED_LEN,
19558 __tmp.remaining(),
19559 )
19560 }
19561 __tmp.put_i16_le(self.start_index);
19562 __tmp.put_i16_le(self.end_index);
19563 __tmp.put_u8(self.target_system);
19564 __tmp.put_u8(self.target_component);
19565 __tmp.put_u8(self.mission_type as u8);
19566 if matches!(version, MavlinkVersion::V2) {
19567 let len = __tmp.len();
19568 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19569 } else {
19570 __tmp.len()
19571 }
19572 }
19573}
19574#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
19575#[doc = "id: 41"]
19576#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
19577#[derive(Debug, Clone, PartialEq)]
19578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19580pub struct MISSION_SET_CURRENT_DATA {
19581 #[doc = "Sequence"]
19582 pub seq: u16,
19583 #[doc = "System ID"]
19584 pub target_system: u8,
19585 #[doc = "Component ID"]
19586 pub target_component: u8,
19587}
19588impl MISSION_SET_CURRENT_DATA {
19589 pub const ENCODED_LEN: usize = 4usize;
19590 pub const DEFAULT: Self = Self {
19591 seq: 0_u16,
19592 target_system: 0_u8,
19593 target_component: 0_u8,
19594 };
19595 #[cfg(feature = "arbitrary")]
19596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19597 use arbitrary::{Arbitrary, Unstructured};
19598 let mut buf = [0u8; 1024];
19599 rng.fill_bytes(&mut buf);
19600 let mut unstructured = Unstructured::new(&buf);
19601 Self::arbitrary(&mut unstructured).unwrap_or_default()
19602 }
19603}
19604impl Default for MISSION_SET_CURRENT_DATA {
19605 fn default() -> Self {
19606 Self::DEFAULT.clone()
19607 }
19608}
19609impl MessageData for MISSION_SET_CURRENT_DATA {
19610 type Message = MavMessage;
19611 const ID: u32 = 41u32;
19612 const NAME: &'static str = "MISSION_SET_CURRENT";
19613 const EXTRA_CRC: u8 = 28u8;
19614 const ENCODED_LEN: usize = 4usize;
19615 fn deser(
19616 _version: MavlinkVersion,
19617 __input: &[u8],
19618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19619 let avail_len = __input.len();
19620 let mut payload_buf = [0; Self::ENCODED_LEN];
19621 let mut buf = if avail_len < Self::ENCODED_LEN {
19622 payload_buf[0..avail_len].copy_from_slice(__input);
19623 Bytes::new(&payload_buf)
19624 } else {
19625 Bytes::new(__input)
19626 };
19627 let mut __struct = Self::default();
19628 __struct.seq = buf.get_u16_le();
19629 __struct.target_system = buf.get_u8();
19630 __struct.target_component = buf.get_u8();
19631 Ok(__struct)
19632 }
19633 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19634 let mut __tmp = BytesMut::new(bytes);
19635 #[allow(clippy::absurd_extreme_comparisons)]
19636 #[allow(unused_comparisons)]
19637 if __tmp.remaining() < Self::ENCODED_LEN {
19638 panic!(
19639 "buffer is too small (need {} bytes, but got {})",
19640 Self::ENCODED_LEN,
19641 __tmp.remaining(),
19642 )
19643 }
19644 __tmp.put_u16_le(self.seq);
19645 __tmp.put_u8(self.target_system);
19646 __tmp.put_u8(self.target_component);
19647 if matches!(version, MavlinkVersion::V2) {
19648 let len = __tmp.len();
19649 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19650 } else {
19651 __tmp.len()
19652 }
19653 }
19654}
19655#[doc = "id: 38"]
19656#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
19657#[derive(Debug, Clone, PartialEq)]
19658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19660pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
19661 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
19662 pub start_index: i16,
19663 #[doc = "End index, equal or greater than start index."]
19664 pub end_index: i16,
19665 #[doc = "System ID"]
19666 pub target_system: u8,
19667 #[doc = "Component ID"]
19668 pub target_component: u8,
19669 #[doc = "Mission type."]
19670 #[cfg_attr(feature = "serde", serde(default))]
19671 pub mission_type: MavMissionType,
19672}
19673impl MISSION_WRITE_PARTIAL_LIST_DATA {
19674 pub const ENCODED_LEN: usize = 7usize;
19675 pub const DEFAULT: Self = Self {
19676 start_index: 0_i16,
19677 end_index: 0_i16,
19678 target_system: 0_u8,
19679 target_component: 0_u8,
19680 mission_type: MavMissionType::DEFAULT,
19681 };
19682 #[cfg(feature = "arbitrary")]
19683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19684 use arbitrary::{Arbitrary, Unstructured};
19685 let mut buf = [0u8; 1024];
19686 rng.fill_bytes(&mut buf);
19687 let mut unstructured = Unstructured::new(&buf);
19688 Self::arbitrary(&mut unstructured).unwrap_or_default()
19689 }
19690}
19691impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
19692 fn default() -> Self {
19693 Self::DEFAULT.clone()
19694 }
19695}
19696impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
19697 type Message = MavMessage;
19698 const ID: u32 = 38u32;
19699 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
19700 const EXTRA_CRC: u8 = 9u8;
19701 const ENCODED_LEN: usize = 7usize;
19702 fn deser(
19703 _version: MavlinkVersion,
19704 __input: &[u8],
19705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19706 let avail_len = __input.len();
19707 let mut payload_buf = [0; Self::ENCODED_LEN];
19708 let mut buf = if avail_len < Self::ENCODED_LEN {
19709 payload_buf[0..avail_len].copy_from_slice(__input);
19710 Bytes::new(&payload_buf)
19711 } else {
19712 Bytes::new(__input)
19713 };
19714 let mut __struct = Self::default();
19715 __struct.start_index = buf.get_i16_le();
19716 __struct.end_index = buf.get_i16_le();
19717 __struct.target_system = buf.get_u8();
19718 __struct.target_component = buf.get_u8();
19719 let tmp = buf.get_u8();
19720 __struct.mission_type =
19721 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19722 enum_type: "MavMissionType",
19723 value: tmp as u32,
19724 })?;
19725 Ok(__struct)
19726 }
19727 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19728 let mut __tmp = BytesMut::new(bytes);
19729 #[allow(clippy::absurd_extreme_comparisons)]
19730 #[allow(unused_comparisons)]
19731 if __tmp.remaining() < Self::ENCODED_LEN {
19732 panic!(
19733 "buffer is too small (need {} bytes, but got {})",
19734 Self::ENCODED_LEN,
19735 __tmp.remaining(),
19736 )
19737 }
19738 __tmp.put_i16_le(self.start_index);
19739 __tmp.put_i16_le(self.end_index);
19740 __tmp.put_u8(self.target_system);
19741 __tmp.put_u8(self.target_component);
19742 __tmp.put_u8(self.mission_type as u8);
19743 if matches!(version, MavlinkVersion::V2) {
19744 let len = __tmp.len();
19745 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19746 } else {
19747 __tmp.len()
19748 }
19749 }
19750}
19751#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
19752#[doc = "id: 265"]
19753#[doc = "Orientation of a mount."]
19754#[derive(Debug, Clone, PartialEq)]
19755#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19756#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19757pub struct MOUNT_ORIENTATION_DATA {
19758 #[doc = "Timestamp (time since system boot)."]
19759 pub time_boot_ms: u32,
19760 #[doc = "Roll in global frame (set to NaN for invalid)."]
19761 pub roll: f32,
19762 #[doc = "Pitch in global frame (set to NaN for invalid)."]
19763 pub pitch: f32,
19764 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
19765 pub yaw: f32,
19766 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
19767 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19768 pub yaw_absolute: f32,
19769}
19770impl MOUNT_ORIENTATION_DATA {
19771 pub const ENCODED_LEN: usize = 20usize;
19772 pub const DEFAULT: Self = Self {
19773 time_boot_ms: 0_u32,
19774 roll: 0.0_f32,
19775 pitch: 0.0_f32,
19776 yaw: 0.0_f32,
19777 yaw_absolute: 0.0_f32,
19778 };
19779 #[cfg(feature = "arbitrary")]
19780 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19781 use arbitrary::{Arbitrary, Unstructured};
19782 let mut buf = [0u8; 1024];
19783 rng.fill_bytes(&mut buf);
19784 let mut unstructured = Unstructured::new(&buf);
19785 Self::arbitrary(&mut unstructured).unwrap_or_default()
19786 }
19787}
19788impl Default for MOUNT_ORIENTATION_DATA {
19789 fn default() -> Self {
19790 Self::DEFAULT.clone()
19791 }
19792}
19793impl MessageData for MOUNT_ORIENTATION_DATA {
19794 type Message = MavMessage;
19795 const ID: u32 = 265u32;
19796 const NAME: &'static str = "MOUNT_ORIENTATION";
19797 const EXTRA_CRC: u8 = 26u8;
19798 const ENCODED_LEN: usize = 20usize;
19799 fn deser(
19800 _version: MavlinkVersion,
19801 __input: &[u8],
19802 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19803 let avail_len = __input.len();
19804 let mut payload_buf = [0; Self::ENCODED_LEN];
19805 let mut buf = if avail_len < Self::ENCODED_LEN {
19806 payload_buf[0..avail_len].copy_from_slice(__input);
19807 Bytes::new(&payload_buf)
19808 } else {
19809 Bytes::new(__input)
19810 };
19811 let mut __struct = Self::default();
19812 __struct.time_boot_ms = buf.get_u32_le();
19813 __struct.roll = buf.get_f32_le();
19814 __struct.pitch = buf.get_f32_le();
19815 __struct.yaw = buf.get_f32_le();
19816 __struct.yaw_absolute = buf.get_f32_le();
19817 Ok(__struct)
19818 }
19819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19820 let mut __tmp = BytesMut::new(bytes);
19821 #[allow(clippy::absurd_extreme_comparisons)]
19822 #[allow(unused_comparisons)]
19823 if __tmp.remaining() < Self::ENCODED_LEN {
19824 panic!(
19825 "buffer is too small (need {} bytes, but got {})",
19826 Self::ENCODED_LEN,
19827 __tmp.remaining(),
19828 )
19829 }
19830 __tmp.put_u32_le(self.time_boot_ms);
19831 __tmp.put_f32_le(self.roll);
19832 __tmp.put_f32_le(self.pitch);
19833 __tmp.put_f32_le(self.yaw);
19834 __tmp.put_f32_le(self.yaw_absolute);
19835 if matches!(version, MavlinkVersion::V2) {
19836 let len = __tmp.len();
19837 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19838 } else {
19839 __tmp.len()
19840 }
19841 }
19842}
19843#[doc = "id: 251"]
19844#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19845#[derive(Debug, Clone, PartialEq)]
19846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19847#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19848pub struct NAMED_VALUE_FLOAT_DATA {
19849 #[doc = "Timestamp (time since system boot)."]
19850 pub time_boot_ms: u32,
19851 #[doc = "Floating point value"]
19852 pub value: f32,
19853 #[doc = "Name of the debug variable"]
19854 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19855 pub name: [u8; 10],
19856}
19857impl NAMED_VALUE_FLOAT_DATA {
19858 pub const ENCODED_LEN: usize = 18usize;
19859 pub const DEFAULT: Self = Self {
19860 time_boot_ms: 0_u32,
19861 value: 0.0_f32,
19862 name: [0_u8; 10usize],
19863 };
19864 #[cfg(feature = "arbitrary")]
19865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19866 use arbitrary::{Arbitrary, Unstructured};
19867 let mut buf = [0u8; 1024];
19868 rng.fill_bytes(&mut buf);
19869 let mut unstructured = Unstructured::new(&buf);
19870 Self::arbitrary(&mut unstructured).unwrap_or_default()
19871 }
19872}
19873impl Default for NAMED_VALUE_FLOAT_DATA {
19874 fn default() -> Self {
19875 Self::DEFAULT.clone()
19876 }
19877}
19878impl MessageData for NAMED_VALUE_FLOAT_DATA {
19879 type Message = MavMessage;
19880 const ID: u32 = 251u32;
19881 const NAME: &'static str = "NAMED_VALUE_FLOAT";
19882 const EXTRA_CRC: u8 = 170u8;
19883 const ENCODED_LEN: usize = 18usize;
19884 fn deser(
19885 _version: MavlinkVersion,
19886 __input: &[u8],
19887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19888 let avail_len = __input.len();
19889 let mut payload_buf = [0; Self::ENCODED_LEN];
19890 let mut buf = if avail_len < Self::ENCODED_LEN {
19891 payload_buf[0..avail_len].copy_from_slice(__input);
19892 Bytes::new(&payload_buf)
19893 } else {
19894 Bytes::new(__input)
19895 };
19896 let mut __struct = Self::default();
19897 __struct.time_boot_ms = buf.get_u32_le();
19898 __struct.value = buf.get_f32_le();
19899 for v in &mut __struct.name {
19900 let val = buf.get_u8();
19901 *v = val;
19902 }
19903 Ok(__struct)
19904 }
19905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19906 let mut __tmp = BytesMut::new(bytes);
19907 #[allow(clippy::absurd_extreme_comparisons)]
19908 #[allow(unused_comparisons)]
19909 if __tmp.remaining() < Self::ENCODED_LEN {
19910 panic!(
19911 "buffer is too small (need {} bytes, but got {})",
19912 Self::ENCODED_LEN,
19913 __tmp.remaining(),
19914 )
19915 }
19916 __tmp.put_u32_le(self.time_boot_ms);
19917 __tmp.put_f32_le(self.value);
19918 for val in &self.name {
19919 __tmp.put_u8(*val);
19920 }
19921 if matches!(version, MavlinkVersion::V2) {
19922 let len = __tmp.len();
19923 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19924 } else {
19925 __tmp.len()
19926 }
19927 }
19928}
19929#[doc = "id: 252"]
19930#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19931#[derive(Debug, Clone, PartialEq)]
19932#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19933#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19934pub struct NAMED_VALUE_INT_DATA {
19935 #[doc = "Timestamp (time since system boot)."]
19936 pub time_boot_ms: u32,
19937 #[doc = "Signed integer value"]
19938 pub value: i32,
19939 #[doc = "Name of the debug variable"]
19940 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19941 pub name: [u8; 10],
19942}
19943impl NAMED_VALUE_INT_DATA {
19944 pub const ENCODED_LEN: usize = 18usize;
19945 pub const DEFAULT: Self = Self {
19946 time_boot_ms: 0_u32,
19947 value: 0_i32,
19948 name: [0_u8; 10usize],
19949 };
19950 #[cfg(feature = "arbitrary")]
19951 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19952 use arbitrary::{Arbitrary, Unstructured};
19953 let mut buf = [0u8; 1024];
19954 rng.fill_bytes(&mut buf);
19955 let mut unstructured = Unstructured::new(&buf);
19956 Self::arbitrary(&mut unstructured).unwrap_or_default()
19957 }
19958}
19959impl Default for NAMED_VALUE_INT_DATA {
19960 fn default() -> Self {
19961 Self::DEFAULT.clone()
19962 }
19963}
19964impl MessageData for NAMED_VALUE_INT_DATA {
19965 type Message = MavMessage;
19966 const ID: u32 = 252u32;
19967 const NAME: &'static str = "NAMED_VALUE_INT";
19968 const EXTRA_CRC: u8 = 44u8;
19969 const ENCODED_LEN: usize = 18usize;
19970 fn deser(
19971 _version: MavlinkVersion,
19972 __input: &[u8],
19973 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19974 let avail_len = __input.len();
19975 let mut payload_buf = [0; Self::ENCODED_LEN];
19976 let mut buf = if avail_len < Self::ENCODED_LEN {
19977 payload_buf[0..avail_len].copy_from_slice(__input);
19978 Bytes::new(&payload_buf)
19979 } else {
19980 Bytes::new(__input)
19981 };
19982 let mut __struct = Self::default();
19983 __struct.time_boot_ms = buf.get_u32_le();
19984 __struct.value = buf.get_i32_le();
19985 for v in &mut __struct.name {
19986 let val = buf.get_u8();
19987 *v = val;
19988 }
19989 Ok(__struct)
19990 }
19991 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19992 let mut __tmp = BytesMut::new(bytes);
19993 #[allow(clippy::absurd_extreme_comparisons)]
19994 #[allow(unused_comparisons)]
19995 if __tmp.remaining() < Self::ENCODED_LEN {
19996 panic!(
19997 "buffer is too small (need {} bytes, but got {})",
19998 Self::ENCODED_LEN,
19999 __tmp.remaining(),
20000 )
20001 }
20002 __tmp.put_u32_le(self.time_boot_ms);
20003 __tmp.put_i32_le(self.value);
20004 for val in &self.name {
20005 __tmp.put_u8(*val);
20006 }
20007 if matches!(version, MavlinkVersion::V2) {
20008 let len = __tmp.len();
20009 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20010 } else {
20011 __tmp.len()
20012 }
20013 }
20014}
20015#[doc = "id: 62"]
20016#[doc = "The state of the navigation and position controller."]
20017#[derive(Debug, Clone, PartialEq)]
20018#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20019#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20020pub struct NAV_CONTROLLER_OUTPUT_DATA {
20021 #[doc = "Current desired roll"]
20022 pub nav_roll: f32,
20023 #[doc = "Current desired pitch"]
20024 pub nav_pitch: f32,
20025 #[doc = "Current altitude error"]
20026 pub alt_error: f32,
20027 #[doc = "Current airspeed error"]
20028 pub aspd_error: f32,
20029 #[doc = "Current crosstrack error on x-y plane"]
20030 pub xtrack_error: f32,
20031 #[doc = "Current desired heading"]
20032 pub nav_bearing: i16,
20033 #[doc = "Bearing to current waypoint/target"]
20034 pub target_bearing: i16,
20035 #[doc = "Distance to active waypoint"]
20036 pub wp_dist: u16,
20037}
20038impl NAV_CONTROLLER_OUTPUT_DATA {
20039 pub const ENCODED_LEN: usize = 26usize;
20040 pub const DEFAULT: Self = Self {
20041 nav_roll: 0.0_f32,
20042 nav_pitch: 0.0_f32,
20043 alt_error: 0.0_f32,
20044 aspd_error: 0.0_f32,
20045 xtrack_error: 0.0_f32,
20046 nav_bearing: 0_i16,
20047 target_bearing: 0_i16,
20048 wp_dist: 0_u16,
20049 };
20050 #[cfg(feature = "arbitrary")]
20051 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20052 use arbitrary::{Arbitrary, Unstructured};
20053 let mut buf = [0u8; 1024];
20054 rng.fill_bytes(&mut buf);
20055 let mut unstructured = Unstructured::new(&buf);
20056 Self::arbitrary(&mut unstructured).unwrap_or_default()
20057 }
20058}
20059impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20060 fn default() -> Self {
20061 Self::DEFAULT.clone()
20062 }
20063}
20064impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20065 type Message = MavMessage;
20066 const ID: u32 = 62u32;
20067 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20068 const EXTRA_CRC: u8 = 183u8;
20069 const ENCODED_LEN: usize = 26usize;
20070 fn deser(
20071 _version: MavlinkVersion,
20072 __input: &[u8],
20073 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20074 let avail_len = __input.len();
20075 let mut payload_buf = [0; Self::ENCODED_LEN];
20076 let mut buf = if avail_len < Self::ENCODED_LEN {
20077 payload_buf[0..avail_len].copy_from_slice(__input);
20078 Bytes::new(&payload_buf)
20079 } else {
20080 Bytes::new(__input)
20081 };
20082 let mut __struct = Self::default();
20083 __struct.nav_roll = buf.get_f32_le();
20084 __struct.nav_pitch = buf.get_f32_le();
20085 __struct.alt_error = buf.get_f32_le();
20086 __struct.aspd_error = buf.get_f32_le();
20087 __struct.xtrack_error = buf.get_f32_le();
20088 __struct.nav_bearing = buf.get_i16_le();
20089 __struct.target_bearing = buf.get_i16_le();
20090 __struct.wp_dist = buf.get_u16_le();
20091 Ok(__struct)
20092 }
20093 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20094 let mut __tmp = BytesMut::new(bytes);
20095 #[allow(clippy::absurd_extreme_comparisons)]
20096 #[allow(unused_comparisons)]
20097 if __tmp.remaining() < Self::ENCODED_LEN {
20098 panic!(
20099 "buffer is too small (need {} bytes, but got {})",
20100 Self::ENCODED_LEN,
20101 __tmp.remaining(),
20102 )
20103 }
20104 __tmp.put_f32_le(self.nav_roll);
20105 __tmp.put_f32_le(self.nav_pitch);
20106 __tmp.put_f32_le(self.alt_error);
20107 __tmp.put_f32_le(self.aspd_error);
20108 __tmp.put_f32_le(self.xtrack_error);
20109 __tmp.put_i16_le(self.nav_bearing);
20110 __tmp.put_i16_le(self.target_bearing);
20111 __tmp.put_u16_le(self.wp_dist);
20112 if matches!(version, MavlinkVersion::V2) {
20113 let len = __tmp.len();
20114 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20115 } else {
20116 __tmp.len()
20117 }
20118 }
20119}
20120#[doc = "id: 330"]
20121#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
20122#[derive(Debug, Clone, PartialEq)]
20123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20124#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20125pub struct OBSTACLE_DISTANCE_DATA {
20126 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20127 pub time_usec: u64,
20128 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
20129 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20130 pub distances: [u16; 72],
20131 #[doc = "Minimum distance the sensor can measure."]
20132 pub min_distance: u16,
20133 #[doc = "Maximum distance the sensor can measure."]
20134 pub max_distance: u16,
20135 #[doc = "Class id of the distance sensor type."]
20136 pub sensor_type: MavDistanceSensor,
20137 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
20138 pub increment: u8,
20139 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
20140 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20141 pub increment_f: f32,
20142 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
20143 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20144 pub angle_offset: f32,
20145 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
20146 #[cfg_attr(feature = "serde", serde(default))]
20147 pub frame: MavFrame,
20148}
20149impl OBSTACLE_DISTANCE_DATA {
20150 pub const ENCODED_LEN: usize = 167usize;
20151 pub const DEFAULT: Self = Self {
20152 time_usec: 0_u64,
20153 distances: [0_u16; 72usize],
20154 min_distance: 0_u16,
20155 max_distance: 0_u16,
20156 sensor_type: MavDistanceSensor::DEFAULT,
20157 increment: 0_u8,
20158 increment_f: 0.0_f32,
20159 angle_offset: 0.0_f32,
20160 frame: MavFrame::DEFAULT,
20161 };
20162 #[cfg(feature = "arbitrary")]
20163 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20164 use arbitrary::{Arbitrary, Unstructured};
20165 let mut buf = [0u8; 1024];
20166 rng.fill_bytes(&mut buf);
20167 let mut unstructured = Unstructured::new(&buf);
20168 Self::arbitrary(&mut unstructured).unwrap_or_default()
20169 }
20170}
20171impl Default for OBSTACLE_DISTANCE_DATA {
20172 fn default() -> Self {
20173 Self::DEFAULT.clone()
20174 }
20175}
20176impl MessageData for OBSTACLE_DISTANCE_DATA {
20177 type Message = MavMessage;
20178 const ID: u32 = 330u32;
20179 const NAME: &'static str = "OBSTACLE_DISTANCE";
20180 const EXTRA_CRC: u8 = 23u8;
20181 const ENCODED_LEN: usize = 167usize;
20182 fn deser(
20183 _version: MavlinkVersion,
20184 __input: &[u8],
20185 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20186 let avail_len = __input.len();
20187 let mut payload_buf = [0; Self::ENCODED_LEN];
20188 let mut buf = if avail_len < Self::ENCODED_LEN {
20189 payload_buf[0..avail_len].copy_from_slice(__input);
20190 Bytes::new(&payload_buf)
20191 } else {
20192 Bytes::new(__input)
20193 };
20194 let mut __struct = Self::default();
20195 __struct.time_usec = buf.get_u64_le();
20196 for v in &mut __struct.distances {
20197 let val = buf.get_u16_le();
20198 *v = val;
20199 }
20200 __struct.min_distance = buf.get_u16_le();
20201 __struct.max_distance = buf.get_u16_le();
20202 let tmp = buf.get_u8();
20203 __struct.sensor_type =
20204 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20205 enum_type: "MavDistanceSensor",
20206 value: tmp as u32,
20207 })?;
20208 __struct.increment = buf.get_u8();
20209 __struct.increment_f = buf.get_f32_le();
20210 __struct.angle_offset = buf.get_f32_le();
20211 let tmp = buf.get_u8();
20212 __struct.frame =
20213 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20214 enum_type: "MavFrame",
20215 value: tmp as u32,
20216 })?;
20217 Ok(__struct)
20218 }
20219 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20220 let mut __tmp = BytesMut::new(bytes);
20221 #[allow(clippy::absurd_extreme_comparisons)]
20222 #[allow(unused_comparisons)]
20223 if __tmp.remaining() < Self::ENCODED_LEN {
20224 panic!(
20225 "buffer is too small (need {} bytes, but got {})",
20226 Self::ENCODED_LEN,
20227 __tmp.remaining(),
20228 )
20229 }
20230 __tmp.put_u64_le(self.time_usec);
20231 for val in &self.distances {
20232 __tmp.put_u16_le(*val);
20233 }
20234 __tmp.put_u16_le(self.min_distance);
20235 __tmp.put_u16_le(self.max_distance);
20236 __tmp.put_u8(self.sensor_type as u8);
20237 __tmp.put_u8(self.increment);
20238 __tmp.put_f32_le(self.increment_f);
20239 __tmp.put_f32_le(self.angle_offset);
20240 __tmp.put_u8(self.frame as u8);
20241 if matches!(version, MavlinkVersion::V2) {
20242 let len = __tmp.len();
20243 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20244 } else {
20245 __tmp.len()
20246 }
20247 }
20248}
20249#[doc = "id: 331"]
20250#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
20251#[derive(Debug, Clone, PartialEq)]
20252#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20254pub struct ODOMETRY_DATA {
20255 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20256 pub time_usec: u64,
20257 #[doc = "X Position"]
20258 pub x: f32,
20259 #[doc = "Y Position"]
20260 pub y: f32,
20261 #[doc = "Z Position"]
20262 pub z: f32,
20263 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
20264 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20265 pub q: [f32; 4],
20266 #[doc = "X linear speed"]
20267 pub vx: f32,
20268 #[doc = "Y linear speed"]
20269 pub vy: f32,
20270 #[doc = "Z linear speed"]
20271 pub vz: f32,
20272 #[doc = "Roll angular speed"]
20273 pub rollspeed: f32,
20274 #[doc = "Pitch angular speed"]
20275 pub pitchspeed: f32,
20276 #[doc = "Yaw angular speed"]
20277 pub yawspeed: f32,
20278 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20279 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20280 pub pose_covariance: [f32; 21],
20281 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20282 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20283 pub velocity_covariance: [f32; 21],
20284 #[doc = "Coordinate frame of reference for the pose data."]
20285 pub frame_id: MavFrame,
20286 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
20287 pub child_frame_id: MavFrame,
20288 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
20289 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20290 pub reset_counter: u8,
20291 #[doc = "Type of estimator that is providing the odometry."]
20292 #[cfg_attr(feature = "serde", serde(default))]
20293 pub estimator_type: MavEstimatorType,
20294 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
20295 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20296 pub quality: i8,
20297}
20298impl ODOMETRY_DATA {
20299 pub const ENCODED_LEN: usize = 233usize;
20300 pub const DEFAULT: Self = Self {
20301 time_usec: 0_u64,
20302 x: 0.0_f32,
20303 y: 0.0_f32,
20304 z: 0.0_f32,
20305 q: [0.0_f32; 4usize],
20306 vx: 0.0_f32,
20307 vy: 0.0_f32,
20308 vz: 0.0_f32,
20309 rollspeed: 0.0_f32,
20310 pitchspeed: 0.0_f32,
20311 yawspeed: 0.0_f32,
20312 pose_covariance: [0.0_f32; 21usize],
20313 velocity_covariance: [0.0_f32; 21usize],
20314 frame_id: MavFrame::DEFAULT,
20315 child_frame_id: MavFrame::DEFAULT,
20316 reset_counter: 0_u8,
20317 estimator_type: MavEstimatorType::DEFAULT,
20318 quality: 0_i8,
20319 };
20320 #[cfg(feature = "arbitrary")]
20321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20322 use arbitrary::{Arbitrary, Unstructured};
20323 let mut buf = [0u8; 1024];
20324 rng.fill_bytes(&mut buf);
20325 let mut unstructured = Unstructured::new(&buf);
20326 Self::arbitrary(&mut unstructured).unwrap_or_default()
20327 }
20328}
20329impl Default for ODOMETRY_DATA {
20330 fn default() -> Self {
20331 Self::DEFAULT.clone()
20332 }
20333}
20334impl MessageData for ODOMETRY_DATA {
20335 type Message = MavMessage;
20336 const ID: u32 = 331u32;
20337 const NAME: &'static str = "ODOMETRY";
20338 const EXTRA_CRC: u8 = 91u8;
20339 const ENCODED_LEN: usize = 233usize;
20340 fn deser(
20341 _version: MavlinkVersion,
20342 __input: &[u8],
20343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20344 let avail_len = __input.len();
20345 let mut payload_buf = [0; Self::ENCODED_LEN];
20346 let mut buf = if avail_len < Self::ENCODED_LEN {
20347 payload_buf[0..avail_len].copy_from_slice(__input);
20348 Bytes::new(&payload_buf)
20349 } else {
20350 Bytes::new(__input)
20351 };
20352 let mut __struct = Self::default();
20353 __struct.time_usec = buf.get_u64_le();
20354 __struct.x = buf.get_f32_le();
20355 __struct.y = buf.get_f32_le();
20356 __struct.z = buf.get_f32_le();
20357 for v in &mut __struct.q {
20358 let val = buf.get_f32_le();
20359 *v = val;
20360 }
20361 __struct.vx = buf.get_f32_le();
20362 __struct.vy = buf.get_f32_le();
20363 __struct.vz = buf.get_f32_le();
20364 __struct.rollspeed = buf.get_f32_le();
20365 __struct.pitchspeed = buf.get_f32_le();
20366 __struct.yawspeed = buf.get_f32_le();
20367 for v in &mut __struct.pose_covariance {
20368 let val = buf.get_f32_le();
20369 *v = val;
20370 }
20371 for v in &mut __struct.velocity_covariance {
20372 let val = buf.get_f32_le();
20373 *v = val;
20374 }
20375 let tmp = buf.get_u8();
20376 __struct.frame_id =
20377 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20378 enum_type: "MavFrame",
20379 value: tmp as u32,
20380 })?;
20381 let tmp = buf.get_u8();
20382 __struct.child_frame_id =
20383 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20384 enum_type: "MavFrame",
20385 value: tmp as u32,
20386 })?;
20387 __struct.reset_counter = buf.get_u8();
20388 let tmp = buf.get_u8();
20389 __struct.estimator_type =
20390 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20391 enum_type: "MavEstimatorType",
20392 value: tmp as u32,
20393 })?;
20394 __struct.quality = buf.get_i8();
20395 Ok(__struct)
20396 }
20397 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20398 let mut __tmp = BytesMut::new(bytes);
20399 #[allow(clippy::absurd_extreme_comparisons)]
20400 #[allow(unused_comparisons)]
20401 if __tmp.remaining() < Self::ENCODED_LEN {
20402 panic!(
20403 "buffer is too small (need {} bytes, but got {})",
20404 Self::ENCODED_LEN,
20405 __tmp.remaining(),
20406 )
20407 }
20408 __tmp.put_u64_le(self.time_usec);
20409 __tmp.put_f32_le(self.x);
20410 __tmp.put_f32_le(self.y);
20411 __tmp.put_f32_le(self.z);
20412 for val in &self.q {
20413 __tmp.put_f32_le(*val);
20414 }
20415 __tmp.put_f32_le(self.vx);
20416 __tmp.put_f32_le(self.vy);
20417 __tmp.put_f32_le(self.vz);
20418 __tmp.put_f32_le(self.rollspeed);
20419 __tmp.put_f32_le(self.pitchspeed);
20420 __tmp.put_f32_le(self.yawspeed);
20421 for val in &self.pose_covariance {
20422 __tmp.put_f32_le(*val);
20423 }
20424 for val in &self.velocity_covariance {
20425 __tmp.put_f32_le(*val);
20426 }
20427 __tmp.put_u8(self.frame_id as u8);
20428 __tmp.put_u8(self.child_frame_id as u8);
20429 __tmp.put_u8(self.reset_counter);
20430 __tmp.put_u8(self.estimator_type as u8);
20431 __tmp.put_i8(self.quality);
20432 if matches!(version, MavlinkVersion::V2) {
20433 let len = __tmp.len();
20434 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20435 } else {
20436 __tmp.len()
20437 }
20438 }
20439}
20440#[doc = "id: 390"]
20441#[doc = "Hardware status sent by an onboard computer."]
20442#[derive(Debug, Clone, PartialEq)]
20443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20445pub struct ONBOARD_COMPUTER_STATUS_DATA {
20446 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20447 pub time_usec: u64,
20448 #[doc = "Time since system boot."]
20449 pub uptime: u32,
20450 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20451 pub ram_usage: u32,
20452 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20453 pub ram_total: u32,
20454 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
20455 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20456 pub storage_type: [u32; 4],
20457 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20458 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20459 pub storage_usage: [u32; 4],
20460 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20461 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20462 pub storage_total: [u32; 4],
20463 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
20464 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20465 pub link_type: [u32; 6],
20466 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
20467 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20468 pub link_tx_rate: [u32; 6],
20469 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
20470 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20471 pub link_rx_rate: [u32; 6],
20472 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
20473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20474 pub link_tx_max: [u32; 6],
20475 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
20476 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20477 pub link_rx_max: [u32; 6],
20478 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
20479 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20480 pub fan_speed: [i16; 4],
20481 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
20482 pub mavtype: u8,
20483 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20484 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20485 pub cpu_cores: [u8; 8],
20486 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20487 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20488 pub cpu_combined: [u8; 10],
20489 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20490 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20491 pub gpu_cores: [u8; 4],
20492 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20493 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20494 pub gpu_combined: [u8; 10],
20495 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
20496 pub temperature_board: i8,
20497 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
20498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20499 pub temperature_core: [i8; 8],
20500}
20501impl ONBOARD_COMPUTER_STATUS_DATA {
20502 pub const ENCODED_LEN: usize = 238usize;
20503 pub const DEFAULT: Self = Self {
20504 time_usec: 0_u64,
20505 uptime: 0_u32,
20506 ram_usage: 0_u32,
20507 ram_total: 0_u32,
20508 storage_type: [0_u32; 4usize],
20509 storage_usage: [0_u32; 4usize],
20510 storage_total: [0_u32; 4usize],
20511 link_type: [0_u32; 6usize],
20512 link_tx_rate: [0_u32; 6usize],
20513 link_rx_rate: [0_u32; 6usize],
20514 link_tx_max: [0_u32; 6usize],
20515 link_rx_max: [0_u32; 6usize],
20516 fan_speed: [0_i16; 4usize],
20517 mavtype: 0_u8,
20518 cpu_cores: [0_u8; 8usize],
20519 cpu_combined: [0_u8; 10usize],
20520 gpu_cores: [0_u8; 4usize],
20521 gpu_combined: [0_u8; 10usize],
20522 temperature_board: 0_i8,
20523 temperature_core: [0_i8; 8usize],
20524 };
20525 #[cfg(feature = "arbitrary")]
20526 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20527 use arbitrary::{Arbitrary, Unstructured};
20528 let mut buf = [0u8; 1024];
20529 rng.fill_bytes(&mut buf);
20530 let mut unstructured = Unstructured::new(&buf);
20531 Self::arbitrary(&mut unstructured).unwrap_or_default()
20532 }
20533}
20534impl Default for ONBOARD_COMPUTER_STATUS_DATA {
20535 fn default() -> Self {
20536 Self::DEFAULT.clone()
20537 }
20538}
20539impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
20540 type Message = MavMessage;
20541 const ID: u32 = 390u32;
20542 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
20543 const EXTRA_CRC: u8 = 156u8;
20544 const ENCODED_LEN: usize = 238usize;
20545 fn deser(
20546 _version: MavlinkVersion,
20547 __input: &[u8],
20548 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20549 let avail_len = __input.len();
20550 let mut payload_buf = [0; Self::ENCODED_LEN];
20551 let mut buf = if avail_len < Self::ENCODED_LEN {
20552 payload_buf[0..avail_len].copy_from_slice(__input);
20553 Bytes::new(&payload_buf)
20554 } else {
20555 Bytes::new(__input)
20556 };
20557 let mut __struct = Self::default();
20558 __struct.time_usec = buf.get_u64_le();
20559 __struct.uptime = buf.get_u32_le();
20560 __struct.ram_usage = buf.get_u32_le();
20561 __struct.ram_total = buf.get_u32_le();
20562 for v in &mut __struct.storage_type {
20563 let val = buf.get_u32_le();
20564 *v = val;
20565 }
20566 for v in &mut __struct.storage_usage {
20567 let val = buf.get_u32_le();
20568 *v = val;
20569 }
20570 for v in &mut __struct.storage_total {
20571 let val = buf.get_u32_le();
20572 *v = val;
20573 }
20574 for v in &mut __struct.link_type {
20575 let val = buf.get_u32_le();
20576 *v = val;
20577 }
20578 for v in &mut __struct.link_tx_rate {
20579 let val = buf.get_u32_le();
20580 *v = val;
20581 }
20582 for v in &mut __struct.link_rx_rate {
20583 let val = buf.get_u32_le();
20584 *v = val;
20585 }
20586 for v in &mut __struct.link_tx_max {
20587 let val = buf.get_u32_le();
20588 *v = val;
20589 }
20590 for v in &mut __struct.link_rx_max {
20591 let val = buf.get_u32_le();
20592 *v = val;
20593 }
20594 for v in &mut __struct.fan_speed {
20595 let val = buf.get_i16_le();
20596 *v = val;
20597 }
20598 __struct.mavtype = buf.get_u8();
20599 for v in &mut __struct.cpu_cores {
20600 let val = buf.get_u8();
20601 *v = val;
20602 }
20603 for v in &mut __struct.cpu_combined {
20604 let val = buf.get_u8();
20605 *v = val;
20606 }
20607 for v in &mut __struct.gpu_cores {
20608 let val = buf.get_u8();
20609 *v = val;
20610 }
20611 for v in &mut __struct.gpu_combined {
20612 let val = buf.get_u8();
20613 *v = val;
20614 }
20615 __struct.temperature_board = buf.get_i8();
20616 for v in &mut __struct.temperature_core {
20617 let val = buf.get_i8();
20618 *v = val;
20619 }
20620 Ok(__struct)
20621 }
20622 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20623 let mut __tmp = BytesMut::new(bytes);
20624 #[allow(clippy::absurd_extreme_comparisons)]
20625 #[allow(unused_comparisons)]
20626 if __tmp.remaining() < Self::ENCODED_LEN {
20627 panic!(
20628 "buffer is too small (need {} bytes, but got {})",
20629 Self::ENCODED_LEN,
20630 __tmp.remaining(),
20631 )
20632 }
20633 __tmp.put_u64_le(self.time_usec);
20634 __tmp.put_u32_le(self.uptime);
20635 __tmp.put_u32_le(self.ram_usage);
20636 __tmp.put_u32_le(self.ram_total);
20637 for val in &self.storage_type {
20638 __tmp.put_u32_le(*val);
20639 }
20640 for val in &self.storage_usage {
20641 __tmp.put_u32_le(*val);
20642 }
20643 for val in &self.storage_total {
20644 __tmp.put_u32_le(*val);
20645 }
20646 for val in &self.link_type {
20647 __tmp.put_u32_le(*val);
20648 }
20649 for val in &self.link_tx_rate {
20650 __tmp.put_u32_le(*val);
20651 }
20652 for val in &self.link_rx_rate {
20653 __tmp.put_u32_le(*val);
20654 }
20655 for val in &self.link_tx_max {
20656 __tmp.put_u32_le(*val);
20657 }
20658 for val in &self.link_rx_max {
20659 __tmp.put_u32_le(*val);
20660 }
20661 for val in &self.fan_speed {
20662 __tmp.put_i16_le(*val);
20663 }
20664 __tmp.put_u8(self.mavtype);
20665 for val in &self.cpu_cores {
20666 __tmp.put_u8(*val);
20667 }
20668 for val in &self.cpu_combined {
20669 __tmp.put_u8(*val);
20670 }
20671 for val in &self.gpu_cores {
20672 __tmp.put_u8(*val);
20673 }
20674 for val in &self.gpu_combined {
20675 __tmp.put_u8(*val);
20676 }
20677 __tmp.put_i8(self.temperature_board);
20678 for val in &self.temperature_core {
20679 __tmp.put_i8(*val);
20680 }
20681 if matches!(version, MavlinkVersion::V2) {
20682 let len = __tmp.len();
20683 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20684 } else {
20685 __tmp.len()
20686 }
20687 }
20688}
20689#[doc = "id: 12918"]
20690#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
20691#[derive(Debug, Clone, PartialEq)]
20692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20693#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20694pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
20695 #[doc = "Status level indicating if arming is allowed."]
20696 pub status: MavOdidArmStatus,
20697 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
20698 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20699 pub error: [u8; 50],
20700}
20701impl OPEN_DRONE_ID_ARM_STATUS_DATA {
20702 pub const ENCODED_LEN: usize = 51usize;
20703 pub const DEFAULT: Self = Self {
20704 status: MavOdidArmStatus::DEFAULT,
20705 error: [0_u8; 50usize],
20706 };
20707 #[cfg(feature = "arbitrary")]
20708 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20709 use arbitrary::{Arbitrary, Unstructured};
20710 let mut buf = [0u8; 1024];
20711 rng.fill_bytes(&mut buf);
20712 let mut unstructured = Unstructured::new(&buf);
20713 Self::arbitrary(&mut unstructured).unwrap_or_default()
20714 }
20715}
20716impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
20717 fn default() -> Self {
20718 Self::DEFAULT.clone()
20719 }
20720}
20721impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
20722 type Message = MavMessage;
20723 const ID: u32 = 12918u32;
20724 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
20725 const EXTRA_CRC: u8 = 139u8;
20726 const ENCODED_LEN: usize = 51usize;
20727 fn deser(
20728 _version: MavlinkVersion,
20729 __input: &[u8],
20730 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20731 let avail_len = __input.len();
20732 let mut payload_buf = [0; Self::ENCODED_LEN];
20733 let mut buf = if avail_len < Self::ENCODED_LEN {
20734 payload_buf[0..avail_len].copy_from_slice(__input);
20735 Bytes::new(&payload_buf)
20736 } else {
20737 Bytes::new(__input)
20738 };
20739 let mut __struct = Self::default();
20740 let tmp = buf.get_u8();
20741 __struct.status =
20742 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20743 enum_type: "MavOdidArmStatus",
20744 value: tmp as u32,
20745 })?;
20746 for v in &mut __struct.error {
20747 let val = buf.get_u8();
20748 *v = val;
20749 }
20750 Ok(__struct)
20751 }
20752 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20753 let mut __tmp = BytesMut::new(bytes);
20754 #[allow(clippy::absurd_extreme_comparisons)]
20755 #[allow(unused_comparisons)]
20756 if __tmp.remaining() < Self::ENCODED_LEN {
20757 panic!(
20758 "buffer is too small (need {} bytes, but got {})",
20759 Self::ENCODED_LEN,
20760 __tmp.remaining(),
20761 )
20762 }
20763 __tmp.put_u8(self.status as u8);
20764 for val in &self.error {
20765 __tmp.put_u8(*val);
20766 }
20767 if matches!(version, MavlinkVersion::V2) {
20768 let len = __tmp.len();
20769 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20770 } else {
20771 __tmp.len()
20772 }
20773 }
20774}
20775#[doc = "id: 12902"]
20776#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
20777#[derive(Debug, Clone, PartialEq)]
20778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20780pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
20781 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
20782 pub timestamp: u32,
20783 #[doc = "System ID (0 for broadcast)."]
20784 pub target_system: u8,
20785 #[doc = "Component ID (0 for broadcast)."]
20786 pub target_component: u8,
20787 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
20788 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20789 pub id_or_mac: [u8; 20],
20790 #[doc = "Indicates the type of authentication."]
20791 pub authentication_type: MavOdidAuthType,
20792 #[doc = "Allowed range is 0 - 15."]
20793 pub data_page: u8,
20794 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
20795 pub last_page_index: u8,
20796 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
20797 pub length: u8,
20798 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
20799 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20800 pub authentication_data: [u8; 23],
20801}
20802impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
20803 pub const ENCODED_LEN: usize = 53usize;
20804 pub const DEFAULT: Self = Self {
20805 timestamp: 0_u32,
20806 target_system: 0_u8,
20807 target_component: 0_u8,
20808 id_or_mac: [0_u8; 20usize],
20809 authentication_type: MavOdidAuthType::DEFAULT,
20810 data_page: 0_u8,
20811 last_page_index: 0_u8,
20812 length: 0_u8,
20813 authentication_data: [0_u8; 23usize],
20814 };
20815 #[cfg(feature = "arbitrary")]
20816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20817 use arbitrary::{Arbitrary, Unstructured};
20818 let mut buf = [0u8; 1024];
20819 rng.fill_bytes(&mut buf);
20820 let mut unstructured = Unstructured::new(&buf);
20821 Self::arbitrary(&mut unstructured).unwrap_or_default()
20822 }
20823}
20824impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
20825 fn default() -> Self {
20826 Self::DEFAULT.clone()
20827 }
20828}
20829impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
20830 type Message = MavMessage;
20831 const ID: u32 = 12902u32;
20832 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
20833 const EXTRA_CRC: u8 = 140u8;
20834 const ENCODED_LEN: usize = 53usize;
20835 fn deser(
20836 _version: MavlinkVersion,
20837 __input: &[u8],
20838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20839 let avail_len = __input.len();
20840 let mut payload_buf = [0; Self::ENCODED_LEN];
20841 let mut buf = if avail_len < Self::ENCODED_LEN {
20842 payload_buf[0..avail_len].copy_from_slice(__input);
20843 Bytes::new(&payload_buf)
20844 } else {
20845 Bytes::new(__input)
20846 };
20847 let mut __struct = Self::default();
20848 __struct.timestamp = buf.get_u32_le();
20849 __struct.target_system = buf.get_u8();
20850 __struct.target_component = buf.get_u8();
20851 for v in &mut __struct.id_or_mac {
20852 let val = buf.get_u8();
20853 *v = val;
20854 }
20855 let tmp = buf.get_u8();
20856 __struct.authentication_type =
20857 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20858 enum_type: "MavOdidAuthType",
20859 value: tmp as u32,
20860 })?;
20861 __struct.data_page = buf.get_u8();
20862 __struct.last_page_index = buf.get_u8();
20863 __struct.length = buf.get_u8();
20864 for v in &mut __struct.authentication_data {
20865 let val = buf.get_u8();
20866 *v = val;
20867 }
20868 Ok(__struct)
20869 }
20870 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20871 let mut __tmp = BytesMut::new(bytes);
20872 #[allow(clippy::absurd_extreme_comparisons)]
20873 #[allow(unused_comparisons)]
20874 if __tmp.remaining() < Self::ENCODED_LEN {
20875 panic!(
20876 "buffer is too small (need {} bytes, but got {})",
20877 Self::ENCODED_LEN,
20878 __tmp.remaining(),
20879 )
20880 }
20881 __tmp.put_u32_le(self.timestamp);
20882 __tmp.put_u8(self.target_system);
20883 __tmp.put_u8(self.target_component);
20884 for val in &self.id_or_mac {
20885 __tmp.put_u8(*val);
20886 }
20887 __tmp.put_u8(self.authentication_type as u8);
20888 __tmp.put_u8(self.data_page);
20889 __tmp.put_u8(self.last_page_index);
20890 __tmp.put_u8(self.length);
20891 for val in &self.authentication_data {
20892 __tmp.put_u8(*val);
20893 }
20894 if matches!(version, MavlinkVersion::V2) {
20895 let len = __tmp.len();
20896 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20897 } else {
20898 __tmp.len()
20899 }
20900 }
20901}
20902#[doc = "id: 12900"]
20903#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
20904#[derive(Debug, Clone, PartialEq)]
20905#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20907pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
20908 #[doc = "System ID (0 for broadcast)."]
20909 pub target_system: u8,
20910 #[doc = "Component ID (0 for broadcast)."]
20911 pub target_component: u8,
20912 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
20913 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20914 pub id_or_mac: [u8; 20],
20915 #[doc = "Indicates the format for the uas_id field of this message."]
20916 pub id_type: MavOdidIdType,
20917 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
20918 pub ua_type: MavOdidUaType,
20919 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
20920 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20921 pub uas_id: [u8; 20],
20922}
20923impl OPEN_DRONE_ID_BASIC_ID_DATA {
20924 pub const ENCODED_LEN: usize = 44usize;
20925 pub const DEFAULT: Self = Self {
20926 target_system: 0_u8,
20927 target_component: 0_u8,
20928 id_or_mac: [0_u8; 20usize],
20929 id_type: MavOdidIdType::DEFAULT,
20930 ua_type: MavOdidUaType::DEFAULT,
20931 uas_id: [0_u8; 20usize],
20932 };
20933 #[cfg(feature = "arbitrary")]
20934 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20935 use arbitrary::{Arbitrary, Unstructured};
20936 let mut buf = [0u8; 1024];
20937 rng.fill_bytes(&mut buf);
20938 let mut unstructured = Unstructured::new(&buf);
20939 Self::arbitrary(&mut unstructured).unwrap_or_default()
20940 }
20941}
20942impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
20943 fn default() -> Self {
20944 Self::DEFAULT.clone()
20945 }
20946}
20947impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
20948 type Message = MavMessage;
20949 const ID: u32 = 12900u32;
20950 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
20951 const EXTRA_CRC: u8 = 114u8;
20952 const ENCODED_LEN: usize = 44usize;
20953 fn deser(
20954 _version: MavlinkVersion,
20955 __input: &[u8],
20956 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20957 let avail_len = __input.len();
20958 let mut payload_buf = [0; Self::ENCODED_LEN];
20959 let mut buf = if avail_len < Self::ENCODED_LEN {
20960 payload_buf[0..avail_len].copy_from_slice(__input);
20961 Bytes::new(&payload_buf)
20962 } else {
20963 Bytes::new(__input)
20964 };
20965 let mut __struct = Self::default();
20966 __struct.target_system = buf.get_u8();
20967 __struct.target_component = buf.get_u8();
20968 for v in &mut __struct.id_or_mac {
20969 let val = buf.get_u8();
20970 *v = val;
20971 }
20972 let tmp = buf.get_u8();
20973 __struct.id_type =
20974 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20975 enum_type: "MavOdidIdType",
20976 value: tmp as u32,
20977 })?;
20978 let tmp = buf.get_u8();
20979 __struct.ua_type =
20980 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20981 enum_type: "MavOdidUaType",
20982 value: tmp as u32,
20983 })?;
20984 for v in &mut __struct.uas_id {
20985 let val = buf.get_u8();
20986 *v = val;
20987 }
20988 Ok(__struct)
20989 }
20990 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20991 let mut __tmp = BytesMut::new(bytes);
20992 #[allow(clippy::absurd_extreme_comparisons)]
20993 #[allow(unused_comparisons)]
20994 if __tmp.remaining() < Self::ENCODED_LEN {
20995 panic!(
20996 "buffer is too small (need {} bytes, but got {})",
20997 Self::ENCODED_LEN,
20998 __tmp.remaining(),
20999 )
21000 }
21001 __tmp.put_u8(self.target_system);
21002 __tmp.put_u8(self.target_component);
21003 for val in &self.id_or_mac {
21004 __tmp.put_u8(*val);
21005 }
21006 __tmp.put_u8(self.id_type as u8);
21007 __tmp.put_u8(self.ua_type as u8);
21008 for val in &self.uas_id {
21009 __tmp.put_u8(*val);
21010 }
21011 if matches!(version, MavlinkVersion::V2) {
21012 let len = __tmp.len();
21013 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21014 } else {
21015 __tmp.len()
21016 }
21017 }
21018}
21019#[doc = "id: 12901"]
21020#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21021#[derive(Debug, Clone, PartialEq)]
21022#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21023#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21024pub struct OPEN_DRONE_ID_LOCATION_DATA {
21025 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21026 pub latitude: i32,
21027 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21028 pub longitude: i32,
21029 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21030 pub altitude_barometric: f32,
21031 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21032 pub altitude_geodetic: f32,
21033 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21034 pub height: f32,
21035 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21036 pub timestamp: f32,
21037 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21038 pub direction: u16,
21039 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21040 pub speed_horizontal: u16,
21041 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21042 pub speed_vertical: i16,
21043 #[doc = "System ID (0 for broadcast)."]
21044 pub target_system: u8,
21045 #[doc = "Component ID (0 for broadcast)."]
21046 pub target_component: u8,
21047 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21048 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21049 pub id_or_mac: [u8; 20],
21050 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21051 pub status: MavOdidStatus,
21052 #[doc = "Indicates the reference point for the height field."]
21053 pub height_reference: MavOdidHeightRef,
21054 #[doc = "The accuracy of the horizontal position."]
21055 pub horizontal_accuracy: MavOdidHorAcc,
21056 #[doc = "The accuracy of the vertical position."]
21057 pub vertical_accuracy: MavOdidVerAcc,
21058 #[doc = "The accuracy of the barometric altitude."]
21059 pub barometer_accuracy: MavOdidVerAcc,
21060 #[doc = "The accuracy of the horizontal and vertical speed."]
21061 pub speed_accuracy: MavOdidSpeedAcc,
21062 #[doc = "The accuracy of the timestamps."]
21063 pub timestamp_accuracy: MavOdidTimeAcc,
21064}
21065impl OPEN_DRONE_ID_LOCATION_DATA {
21066 pub const ENCODED_LEN: usize = 59usize;
21067 pub const DEFAULT: Self = Self {
21068 latitude: 0_i32,
21069 longitude: 0_i32,
21070 altitude_barometric: 0.0_f32,
21071 altitude_geodetic: 0.0_f32,
21072 height: 0.0_f32,
21073 timestamp: 0.0_f32,
21074 direction: 0_u16,
21075 speed_horizontal: 0_u16,
21076 speed_vertical: 0_i16,
21077 target_system: 0_u8,
21078 target_component: 0_u8,
21079 id_or_mac: [0_u8; 20usize],
21080 status: MavOdidStatus::DEFAULT,
21081 height_reference: MavOdidHeightRef::DEFAULT,
21082 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21083 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21084 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21085 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21086 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21087 };
21088 #[cfg(feature = "arbitrary")]
21089 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21090 use arbitrary::{Arbitrary, Unstructured};
21091 let mut buf = [0u8; 1024];
21092 rng.fill_bytes(&mut buf);
21093 let mut unstructured = Unstructured::new(&buf);
21094 Self::arbitrary(&mut unstructured).unwrap_or_default()
21095 }
21096}
21097impl Default for OPEN_DRONE_ID_LOCATION_DATA {
21098 fn default() -> Self {
21099 Self::DEFAULT.clone()
21100 }
21101}
21102impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
21103 type Message = MavMessage;
21104 const ID: u32 = 12901u32;
21105 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
21106 const EXTRA_CRC: u8 = 254u8;
21107 const ENCODED_LEN: usize = 59usize;
21108 fn deser(
21109 _version: MavlinkVersion,
21110 __input: &[u8],
21111 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21112 let avail_len = __input.len();
21113 let mut payload_buf = [0; Self::ENCODED_LEN];
21114 let mut buf = if avail_len < Self::ENCODED_LEN {
21115 payload_buf[0..avail_len].copy_from_slice(__input);
21116 Bytes::new(&payload_buf)
21117 } else {
21118 Bytes::new(__input)
21119 };
21120 let mut __struct = Self::default();
21121 __struct.latitude = buf.get_i32_le();
21122 __struct.longitude = buf.get_i32_le();
21123 __struct.altitude_barometric = buf.get_f32_le();
21124 __struct.altitude_geodetic = buf.get_f32_le();
21125 __struct.height = buf.get_f32_le();
21126 __struct.timestamp = buf.get_f32_le();
21127 __struct.direction = buf.get_u16_le();
21128 __struct.speed_horizontal = buf.get_u16_le();
21129 __struct.speed_vertical = buf.get_i16_le();
21130 __struct.target_system = buf.get_u8();
21131 __struct.target_component = buf.get_u8();
21132 for v in &mut __struct.id_or_mac {
21133 let val = buf.get_u8();
21134 *v = val;
21135 }
21136 let tmp = buf.get_u8();
21137 __struct.status =
21138 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21139 enum_type: "MavOdidStatus",
21140 value: tmp as u32,
21141 })?;
21142 let tmp = buf.get_u8();
21143 __struct.height_reference =
21144 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21145 enum_type: "MavOdidHeightRef",
21146 value: tmp as u32,
21147 })?;
21148 let tmp = buf.get_u8();
21149 __struct.horizontal_accuracy =
21150 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21151 enum_type: "MavOdidHorAcc",
21152 value: tmp as u32,
21153 })?;
21154 let tmp = buf.get_u8();
21155 __struct.vertical_accuracy =
21156 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21157 enum_type: "MavOdidVerAcc",
21158 value: tmp as u32,
21159 })?;
21160 let tmp = buf.get_u8();
21161 __struct.barometer_accuracy =
21162 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21163 enum_type: "MavOdidVerAcc",
21164 value: tmp as u32,
21165 })?;
21166 let tmp = buf.get_u8();
21167 __struct.speed_accuracy =
21168 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21169 enum_type: "MavOdidSpeedAcc",
21170 value: tmp as u32,
21171 })?;
21172 let tmp = buf.get_u8();
21173 __struct.timestamp_accuracy =
21174 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21175 enum_type: "MavOdidTimeAcc",
21176 value: tmp as u32,
21177 })?;
21178 Ok(__struct)
21179 }
21180 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21181 let mut __tmp = BytesMut::new(bytes);
21182 #[allow(clippy::absurd_extreme_comparisons)]
21183 #[allow(unused_comparisons)]
21184 if __tmp.remaining() < Self::ENCODED_LEN {
21185 panic!(
21186 "buffer is too small (need {} bytes, but got {})",
21187 Self::ENCODED_LEN,
21188 __tmp.remaining(),
21189 )
21190 }
21191 __tmp.put_i32_le(self.latitude);
21192 __tmp.put_i32_le(self.longitude);
21193 __tmp.put_f32_le(self.altitude_barometric);
21194 __tmp.put_f32_le(self.altitude_geodetic);
21195 __tmp.put_f32_le(self.height);
21196 __tmp.put_f32_le(self.timestamp);
21197 __tmp.put_u16_le(self.direction);
21198 __tmp.put_u16_le(self.speed_horizontal);
21199 __tmp.put_i16_le(self.speed_vertical);
21200 __tmp.put_u8(self.target_system);
21201 __tmp.put_u8(self.target_component);
21202 for val in &self.id_or_mac {
21203 __tmp.put_u8(*val);
21204 }
21205 __tmp.put_u8(self.status as u8);
21206 __tmp.put_u8(self.height_reference as u8);
21207 __tmp.put_u8(self.horizontal_accuracy as u8);
21208 __tmp.put_u8(self.vertical_accuracy as u8);
21209 __tmp.put_u8(self.barometer_accuracy as u8);
21210 __tmp.put_u8(self.speed_accuracy as u8);
21211 __tmp.put_u8(self.timestamp_accuracy as u8);
21212 if matches!(version, MavlinkVersion::V2) {
21213 let len = __tmp.len();
21214 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21215 } else {
21216 __tmp.len()
21217 }
21218 }
21219}
21220#[doc = "id: 12915"]
21221#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
21222#[derive(Debug, Clone, PartialEq)]
21223#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21224#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21225pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21226 #[doc = "System ID (0 for broadcast)."]
21227 pub target_system: u8,
21228 #[doc = "Component ID (0 for broadcast)."]
21229 pub target_component: u8,
21230 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21231 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21232 pub id_or_mac: [u8; 20],
21233 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
21234 pub single_message_size: u8,
21235 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
21236 pub msg_pack_size: u8,
21237 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
21238 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21239 pub messages: [u8; 225],
21240}
21241impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21242 pub const ENCODED_LEN: usize = 249usize;
21243 pub const DEFAULT: Self = Self {
21244 target_system: 0_u8,
21245 target_component: 0_u8,
21246 id_or_mac: [0_u8; 20usize],
21247 single_message_size: 0_u8,
21248 msg_pack_size: 0_u8,
21249 messages: [0_u8; 225usize],
21250 };
21251 #[cfg(feature = "arbitrary")]
21252 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21253 use arbitrary::{Arbitrary, Unstructured};
21254 let mut buf = [0u8; 1024];
21255 rng.fill_bytes(&mut buf);
21256 let mut unstructured = Unstructured::new(&buf);
21257 Self::arbitrary(&mut unstructured).unwrap_or_default()
21258 }
21259}
21260impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21261 fn default() -> Self {
21262 Self::DEFAULT.clone()
21263 }
21264}
21265impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21266 type Message = MavMessage;
21267 const ID: u32 = 12915u32;
21268 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
21269 const EXTRA_CRC: u8 = 94u8;
21270 const ENCODED_LEN: usize = 249usize;
21271 fn deser(
21272 _version: MavlinkVersion,
21273 __input: &[u8],
21274 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21275 let avail_len = __input.len();
21276 let mut payload_buf = [0; Self::ENCODED_LEN];
21277 let mut buf = if avail_len < Self::ENCODED_LEN {
21278 payload_buf[0..avail_len].copy_from_slice(__input);
21279 Bytes::new(&payload_buf)
21280 } else {
21281 Bytes::new(__input)
21282 };
21283 let mut __struct = Self::default();
21284 __struct.target_system = buf.get_u8();
21285 __struct.target_component = buf.get_u8();
21286 for v in &mut __struct.id_or_mac {
21287 let val = buf.get_u8();
21288 *v = val;
21289 }
21290 __struct.single_message_size = buf.get_u8();
21291 __struct.msg_pack_size = buf.get_u8();
21292 for v in &mut __struct.messages {
21293 let val = buf.get_u8();
21294 *v = val;
21295 }
21296 Ok(__struct)
21297 }
21298 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21299 let mut __tmp = BytesMut::new(bytes);
21300 #[allow(clippy::absurd_extreme_comparisons)]
21301 #[allow(unused_comparisons)]
21302 if __tmp.remaining() < Self::ENCODED_LEN {
21303 panic!(
21304 "buffer is too small (need {} bytes, but got {})",
21305 Self::ENCODED_LEN,
21306 __tmp.remaining(),
21307 )
21308 }
21309 __tmp.put_u8(self.target_system);
21310 __tmp.put_u8(self.target_component);
21311 for val in &self.id_or_mac {
21312 __tmp.put_u8(*val);
21313 }
21314 __tmp.put_u8(self.single_message_size);
21315 __tmp.put_u8(self.msg_pack_size);
21316 for val in &self.messages {
21317 __tmp.put_u8(*val);
21318 }
21319 if matches!(version, MavlinkVersion::V2) {
21320 let len = __tmp.len();
21321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21322 } else {
21323 __tmp.len()
21324 }
21325 }
21326}
21327#[doc = "id: 12905"]
21328#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
21329#[derive(Debug, Clone, PartialEq)]
21330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21332pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
21333 #[doc = "System ID (0 for broadcast)."]
21334 pub target_system: u8,
21335 #[doc = "Component ID (0 for broadcast)."]
21336 pub target_component: u8,
21337 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21338 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21339 pub id_or_mac: [u8; 20],
21340 #[doc = "Indicates the type of the operator_id field."]
21341 pub operator_id_type: MavOdidOperatorIdType,
21342 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21343 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21344 pub operator_id: [u8; 20],
21345}
21346impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
21347 pub const ENCODED_LEN: usize = 43usize;
21348 pub const DEFAULT: Self = Self {
21349 target_system: 0_u8,
21350 target_component: 0_u8,
21351 id_or_mac: [0_u8; 20usize],
21352 operator_id_type: MavOdidOperatorIdType::DEFAULT,
21353 operator_id: [0_u8; 20usize],
21354 };
21355 #[cfg(feature = "arbitrary")]
21356 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21357 use arbitrary::{Arbitrary, Unstructured};
21358 let mut buf = [0u8; 1024];
21359 rng.fill_bytes(&mut buf);
21360 let mut unstructured = Unstructured::new(&buf);
21361 Self::arbitrary(&mut unstructured).unwrap_or_default()
21362 }
21363}
21364impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21365 fn default() -> Self {
21366 Self::DEFAULT.clone()
21367 }
21368}
21369impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21370 type Message = MavMessage;
21371 const ID: u32 = 12905u32;
21372 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
21373 const EXTRA_CRC: u8 = 49u8;
21374 const ENCODED_LEN: usize = 43usize;
21375 fn deser(
21376 _version: MavlinkVersion,
21377 __input: &[u8],
21378 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21379 let avail_len = __input.len();
21380 let mut payload_buf = [0; Self::ENCODED_LEN];
21381 let mut buf = if avail_len < Self::ENCODED_LEN {
21382 payload_buf[0..avail_len].copy_from_slice(__input);
21383 Bytes::new(&payload_buf)
21384 } else {
21385 Bytes::new(__input)
21386 };
21387 let mut __struct = Self::default();
21388 __struct.target_system = buf.get_u8();
21389 __struct.target_component = buf.get_u8();
21390 for v in &mut __struct.id_or_mac {
21391 let val = buf.get_u8();
21392 *v = val;
21393 }
21394 let tmp = buf.get_u8();
21395 __struct.operator_id_type =
21396 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21397 enum_type: "MavOdidOperatorIdType",
21398 value: tmp as u32,
21399 })?;
21400 for v in &mut __struct.operator_id {
21401 let val = buf.get_u8();
21402 *v = val;
21403 }
21404 Ok(__struct)
21405 }
21406 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21407 let mut __tmp = BytesMut::new(bytes);
21408 #[allow(clippy::absurd_extreme_comparisons)]
21409 #[allow(unused_comparisons)]
21410 if __tmp.remaining() < Self::ENCODED_LEN {
21411 panic!(
21412 "buffer is too small (need {} bytes, but got {})",
21413 Self::ENCODED_LEN,
21414 __tmp.remaining(),
21415 )
21416 }
21417 __tmp.put_u8(self.target_system);
21418 __tmp.put_u8(self.target_component);
21419 for val in &self.id_or_mac {
21420 __tmp.put_u8(*val);
21421 }
21422 __tmp.put_u8(self.operator_id_type as u8);
21423 for val in &self.operator_id {
21424 __tmp.put_u8(*val);
21425 }
21426 if matches!(version, MavlinkVersion::V2) {
21427 let len = __tmp.len();
21428 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21429 } else {
21430 __tmp.len()
21431 }
21432 }
21433}
21434#[doc = "id: 12903"]
21435#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
21436#[derive(Debug, Clone, PartialEq)]
21437#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21438#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21439pub struct OPEN_DRONE_ID_SELF_ID_DATA {
21440 #[doc = "System ID (0 for broadcast)."]
21441 pub target_system: u8,
21442 #[doc = "Component ID (0 for broadcast)."]
21443 pub target_component: u8,
21444 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21445 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21446 pub id_or_mac: [u8; 20],
21447 #[doc = "Indicates the type of the description field."]
21448 pub description_type: MavOdidDescType,
21449 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21450 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21451 pub description: [u8; 23],
21452}
21453impl OPEN_DRONE_ID_SELF_ID_DATA {
21454 pub const ENCODED_LEN: usize = 46usize;
21455 pub const DEFAULT: Self = Self {
21456 target_system: 0_u8,
21457 target_component: 0_u8,
21458 id_or_mac: [0_u8; 20usize],
21459 description_type: MavOdidDescType::DEFAULT,
21460 description: [0_u8; 23usize],
21461 };
21462 #[cfg(feature = "arbitrary")]
21463 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21464 use arbitrary::{Arbitrary, Unstructured};
21465 let mut buf = [0u8; 1024];
21466 rng.fill_bytes(&mut buf);
21467 let mut unstructured = Unstructured::new(&buf);
21468 Self::arbitrary(&mut unstructured).unwrap_or_default()
21469 }
21470}
21471impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
21472 fn default() -> Self {
21473 Self::DEFAULT.clone()
21474 }
21475}
21476impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
21477 type Message = MavMessage;
21478 const ID: u32 = 12903u32;
21479 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
21480 const EXTRA_CRC: u8 = 249u8;
21481 const ENCODED_LEN: usize = 46usize;
21482 fn deser(
21483 _version: MavlinkVersion,
21484 __input: &[u8],
21485 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21486 let avail_len = __input.len();
21487 let mut payload_buf = [0; Self::ENCODED_LEN];
21488 let mut buf = if avail_len < Self::ENCODED_LEN {
21489 payload_buf[0..avail_len].copy_from_slice(__input);
21490 Bytes::new(&payload_buf)
21491 } else {
21492 Bytes::new(__input)
21493 };
21494 let mut __struct = Self::default();
21495 __struct.target_system = buf.get_u8();
21496 __struct.target_component = buf.get_u8();
21497 for v in &mut __struct.id_or_mac {
21498 let val = buf.get_u8();
21499 *v = val;
21500 }
21501 let tmp = buf.get_u8();
21502 __struct.description_type =
21503 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21504 enum_type: "MavOdidDescType",
21505 value: tmp as u32,
21506 })?;
21507 for v in &mut __struct.description {
21508 let val = buf.get_u8();
21509 *v = val;
21510 }
21511 Ok(__struct)
21512 }
21513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21514 let mut __tmp = BytesMut::new(bytes);
21515 #[allow(clippy::absurd_extreme_comparisons)]
21516 #[allow(unused_comparisons)]
21517 if __tmp.remaining() < Self::ENCODED_LEN {
21518 panic!(
21519 "buffer is too small (need {} bytes, but got {})",
21520 Self::ENCODED_LEN,
21521 __tmp.remaining(),
21522 )
21523 }
21524 __tmp.put_u8(self.target_system);
21525 __tmp.put_u8(self.target_component);
21526 for val in &self.id_or_mac {
21527 __tmp.put_u8(*val);
21528 }
21529 __tmp.put_u8(self.description_type as u8);
21530 for val in &self.description {
21531 __tmp.put_u8(*val);
21532 }
21533 if matches!(version, MavlinkVersion::V2) {
21534 let len = __tmp.len();
21535 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21536 } else {
21537 __tmp.len()
21538 }
21539 }
21540}
21541#[doc = "id: 12904"]
21542#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
21543#[derive(Debug, Clone, PartialEq)]
21544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21546pub struct OPEN_DRONE_ID_SYSTEM_DATA {
21547 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21548 pub operator_latitude: i32,
21549 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21550 pub operator_longitude: i32,
21551 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21552 pub area_ceiling: f32,
21553 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21554 pub area_floor: f32,
21555 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21556 pub operator_altitude_geo: f32,
21557 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21558 pub timestamp: u32,
21559 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
21560 pub area_count: u16,
21561 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
21562 pub area_radius: u16,
21563 #[doc = "System ID (0 for broadcast)."]
21564 pub target_system: u8,
21565 #[doc = "Component ID (0 for broadcast)."]
21566 pub target_component: u8,
21567 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21568 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21569 pub id_or_mac: [u8; 20],
21570 #[doc = "Specifies the operator location type."]
21571 pub operator_location_type: MavOdidOperatorLocationType,
21572 #[doc = "Specifies the classification type of the UA."]
21573 pub classification_type: MavOdidClassificationType,
21574 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
21575 pub category_eu: MavOdidCategoryEu,
21576 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
21577 pub class_eu: MavOdidClassEu,
21578}
21579impl OPEN_DRONE_ID_SYSTEM_DATA {
21580 pub const ENCODED_LEN: usize = 54usize;
21581 pub const DEFAULT: Self = Self {
21582 operator_latitude: 0_i32,
21583 operator_longitude: 0_i32,
21584 area_ceiling: 0.0_f32,
21585 area_floor: 0.0_f32,
21586 operator_altitude_geo: 0.0_f32,
21587 timestamp: 0_u32,
21588 area_count: 0_u16,
21589 area_radius: 0_u16,
21590 target_system: 0_u8,
21591 target_component: 0_u8,
21592 id_or_mac: [0_u8; 20usize],
21593 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
21594 classification_type: MavOdidClassificationType::DEFAULT,
21595 category_eu: MavOdidCategoryEu::DEFAULT,
21596 class_eu: MavOdidClassEu::DEFAULT,
21597 };
21598 #[cfg(feature = "arbitrary")]
21599 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21600 use arbitrary::{Arbitrary, Unstructured};
21601 let mut buf = [0u8; 1024];
21602 rng.fill_bytes(&mut buf);
21603 let mut unstructured = Unstructured::new(&buf);
21604 Self::arbitrary(&mut unstructured).unwrap_or_default()
21605 }
21606}
21607impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
21608 fn default() -> Self {
21609 Self::DEFAULT.clone()
21610 }
21611}
21612impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
21613 type Message = MavMessage;
21614 const ID: u32 = 12904u32;
21615 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
21616 const EXTRA_CRC: u8 = 77u8;
21617 const ENCODED_LEN: usize = 54usize;
21618 fn deser(
21619 _version: MavlinkVersion,
21620 __input: &[u8],
21621 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21622 let avail_len = __input.len();
21623 let mut payload_buf = [0; Self::ENCODED_LEN];
21624 let mut buf = if avail_len < Self::ENCODED_LEN {
21625 payload_buf[0..avail_len].copy_from_slice(__input);
21626 Bytes::new(&payload_buf)
21627 } else {
21628 Bytes::new(__input)
21629 };
21630 let mut __struct = Self::default();
21631 __struct.operator_latitude = buf.get_i32_le();
21632 __struct.operator_longitude = buf.get_i32_le();
21633 __struct.area_ceiling = buf.get_f32_le();
21634 __struct.area_floor = buf.get_f32_le();
21635 __struct.operator_altitude_geo = buf.get_f32_le();
21636 __struct.timestamp = buf.get_u32_le();
21637 __struct.area_count = buf.get_u16_le();
21638 __struct.area_radius = buf.get_u16_le();
21639 __struct.target_system = buf.get_u8();
21640 __struct.target_component = buf.get_u8();
21641 for v in &mut __struct.id_or_mac {
21642 let val = buf.get_u8();
21643 *v = val;
21644 }
21645 let tmp = buf.get_u8();
21646 __struct.operator_location_type =
21647 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21648 enum_type: "MavOdidOperatorLocationType",
21649 value: tmp as u32,
21650 })?;
21651 let tmp = buf.get_u8();
21652 __struct.classification_type =
21653 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21654 enum_type: "MavOdidClassificationType",
21655 value: tmp as u32,
21656 })?;
21657 let tmp = buf.get_u8();
21658 __struct.category_eu =
21659 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21660 enum_type: "MavOdidCategoryEu",
21661 value: tmp as u32,
21662 })?;
21663 let tmp = buf.get_u8();
21664 __struct.class_eu =
21665 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21666 enum_type: "MavOdidClassEu",
21667 value: tmp as u32,
21668 })?;
21669 Ok(__struct)
21670 }
21671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21672 let mut __tmp = BytesMut::new(bytes);
21673 #[allow(clippy::absurd_extreme_comparisons)]
21674 #[allow(unused_comparisons)]
21675 if __tmp.remaining() < Self::ENCODED_LEN {
21676 panic!(
21677 "buffer is too small (need {} bytes, but got {})",
21678 Self::ENCODED_LEN,
21679 __tmp.remaining(),
21680 )
21681 }
21682 __tmp.put_i32_le(self.operator_latitude);
21683 __tmp.put_i32_le(self.operator_longitude);
21684 __tmp.put_f32_le(self.area_ceiling);
21685 __tmp.put_f32_le(self.area_floor);
21686 __tmp.put_f32_le(self.operator_altitude_geo);
21687 __tmp.put_u32_le(self.timestamp);
21688 __tmp.put_u16_le(self.area_count);
21689 __tmp.put_u16_le(self.area_radius);
21690 __tmp.put_u8(self.target_system);
21691 __tmp.put_u8(self.target_component);
21692 for val in &self.id_or_mac {
21693 __tmp.put_u8(*val);
21694 }
21695 __tmp.put_u8(self.operator_location_type as u8);
21696 __tmp.put_u8(self.classification_type as u8);
21697 __tmp.put_u8(self.category_eu as u8);
21698 __tmp.put_u8(self.class_eu as u8);
21699 if matches!(version, MavlinkVersion::V2) {
21700 let len = __tmp.len();
21701 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21702 } else {
21703 __tmp.len()
21704 }
21705 }
21706}
21707#[doc = "id: 12919"]
21708#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
21709#[derive(Debug, Clone, PartialEq)]
21710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21712pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21713 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21714 pub operator_latitude: i32,
21715 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21716 pub operator_longitude: i32,
21717 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21718 pub operator_altitude_geo: f32,
21719 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21720 pub timestamp: u32,
21721 #[doc = "System ID (0 for broadcast)."]
21722 pub target_system: u8,
21723 #[doc = "Component ID (0 for broadcast)."]
21724 pub target_component: u8,
21725}
21726impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21727 pub const ENCODED_LEN: usize = 18usize;
21728 pub const DEFAULT: Self = Self {
21729 operator_latitude: 0_i32,
21730 operator_longitude: 0_i32,
21731 operator_altitude_geo: 0.0_f32,
21732 timestamp: 0_u32,
21733 target_system: 0_u8,
21734 target_component: 0_u8,
21735 };
21736 #[cfg(feature = "arbitrary")]
21737 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21738 use arbitrary::{Arbitrary, Unstructured};
21739 let mut buf = [0u8; 1024];
21740 rng.fill_bytes(&mut buf);
21741 let mut unstructured = Unstructured::new(&buf);
21742 Self::arbitrary(&mut unstructured).unwrap_or_default()
21743 }
21744}
21745impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21746 fn default() -> Self {
21747 Self::DEFAULT.clone()
21748 }
21749}
21750impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21751 type Message = MavMessage;
21752 const ID: u32 = 12919u32;
21753 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
21754 const EXTRA_CRC: u8 = 7u8;
21755 const ENCODED_LEN: usize = 18usize;
21756 fn deser(
21757 _version: MavlinkVersion,
21758 __input: &[u8],
21759 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21760 let avail_len = __input.len();
21761 let mut payload_buf = [0; Self::ENCODED_LEN];
21762 let mut buf = if avail_len < Self::ENCODED_LEN {
21763 payload_buf[0..avail_len].copy_from_slice(__input);
21764 Bytes::new(&payload_buf)
21765 } else {
21766 Bytes::new(__input)
21767 };
21768 let mut __struct = Self::default();
21769 __struct.operator_latitude = buf.get_i32_le();
21770 __struct.operator_longitude = buf.get_i32_le();
21771 __struct.operator_altitude_geo = buf.get_f32_le();
21772 __struct.timestamp = buf.get_u32_le();
21773 __struct.target_system = buf.get_u8();
21774 __struct.target_component = buf.get_u8();
21775 Ok(__struct)
21776 }
21777 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21778 let mut __tmp = BytesMut::new(bytes);
21779 #[allow(clippy::absurd_extreme_comparisons)]
21780 #[allow(unused_comparisons)]
21781 if __tmp.remaining() < Self::ENCODED_LEN {
21782 panic!(
21783 "buffer is too small (need {} bytes, but got {})",
21784 Self::ENCODED_LEN,
21785 __tmp.remaining(),
21786 )
21787 }
21788 __tmp.put_i32_le(self.operator_latitude);
21789 __tmp.put_i32_le(self.operator_longitude);
21790 __tmp.put_f32_le(self.operator_altitude_geo);
21791 __tmp.put_u32_le(self.timestamp);
21792 __tmp.put_u8(self.target_system);
21793 __tmp.put_u8(self.target_component);
21794 if matches!(version, MavlinkVersion::V2) {
21795 let len = __tmp.len();
21796 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21797 } else {
21798 __tmp.len()
21799 }
21800 }
21801}
21802#[doc = "id: 100"]
21803#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
21804#[derive(Debug, Clone, PartialEq)]
21805#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21806#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21807pub struct OPTICAL_FLOW_DATA {
21808 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21809 pub time_usec: u64,
21810 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
21811 pub flow_comp_m_x: f32,
21812 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
21813 pub flow_comp_m_y: f32,
21814 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
21815 pub ground_distance: f32,
21816 #[doc = "Flow in x-sensor direction"]
21817 pub flow_x: i16,
21818 #[doc = "Flow in y-sensor direction"]
21819 pub flow_y: i16,
21820 #[doc = "Sensor ID"]
21821 pub sensor_id: u8,
21822 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
21823 pub quality: u8,
21824 #[doc = "Flow rate about X axis"]
21825 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21826 pub flow_rate_x: f32,
21827 #[doc = "Flow rate about Y axis"]
21828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21829 pub flow_rate_y: f32,
21830}
21831impl OPTICAL_FLOW_DATA {
21832 pub const ENCODED_LEN: usize = 34usize;
21833 pub const DEFAULT: Self = Self {
21834 time_usec: 0_u64,
21835 flow_comp_m_x: 0.0_f32,
21836 flow_comp_m_y: 0.0_f32,
21837 ground_distance: 0.0_f32,
21838 flow_x: 0_i16,
21839 flow_y: 0_i16,
21840 sensor_id: 0_u8,
21841 quality: 0_u8,
21842 flow_rate_x: 0.0_f32,
21843 flow_rate_y: 0.0_f32,
21844 };
21845 #[cfg(feature = "arbitrary")]
21846 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21847 use arbitrary::{Arbitrary, Unstructured};
21848 let mut buf = [0u8; 1024];
21849 rng.fill_bytes(&mut buf);
21850 let mut unstructured = Unstructured::new(&buf);
21851 Self::arbitrary(&mut unstructured).unwrap_or_default()
21852 }
21853}
21854impl Default for OPTICAL_FLOW_DATA {
21855 fn default() -> Self {
21856 Self::DEFAULT.clone()
21857 }
21858}
21859impl MessageData for OPTICAL_FLOW_DATA {
21860 type Message = MavMessage;
21861 const ID: u32 = 100u32;
21862 const NAME: &'static str = "OPTICAL_FLOW";
21863 const EXTRA_CRC: u8 = 175u8;
21864 const ENCODED_LEN: usize = 34usize;
21865 fn deser(
21866 _version: MavlinkVersion,
21867 __input: &[u8],
21868 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21869 let avail_len = __input.len();
21870 let mut payload_buf = [0; Self::ENCODED_LEN];
21871 let mut buf = if avail_len < Self::ENCODED_LEN {
21872 payload_buf[0..avail_len].copy_from_slice(__input);
21873 Bytes::new(&payload_buf)
21874 } else {
21875 Bytes::new(__input)
21876 };
21877 let mut __struct = Self::default();
21878 __struct.time_usec = buf.get_u64_le();
21879 __struct.flow_comp_m_x = buf.get_f32_le();
21880 __struct.flow_comp_m_y = buf.get_f32_le();
21881 __struct.ground_distance = buf.get_f32_le();
21882 __struct.flow_x = buf.get_i16_le();
21883 __struct.flow_y = buf.get_i16_le();
21884 __struct.sensor_id = buf.get_u8();
21885 __struct.quality = buf.get_u8();
21886 __struct.flow_rate_x = buf.get_f32_le();
21887 __struct.flow_rate_y = buf.get_f32_le();
21888 Ok(__struct)
21889 }
21890 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21891 let mut __tmp = BytesMut::new(bytes);
21892 #[allow(clippy::absurd_extreme_comparisons)]
21893 #[allow(unused_comparisons)]
21894 if __tmp.remaining() < Self::ENCODED_LEN {
21895 panic!(
21896 "buffer is too small (need {} bytes, but got {})",
21897 Self::ENCODED_LEN,
21898 __tmp.remaining(),
21899 )
21900 }
21901 __tmp.put_u64_le(self.time_usec);
21902 __tmp.put_f32_le(self.flow_comp_m_x);
21903 __tmp.put_f32_le(self.flow_comp_m_y);
21904 __tmp.put_f32_le(self.ground_distance);
21905 __tmp.put_i16_le(self.flow_x);
21906 __tmp.put_i16_le(self.flow_y);
21907 __tmp.put_u8(self.sensor_id);
21908 __tmp.put_u8(self.quality);
21909 __tmp.put_f32_le(self.flow_rate_x);
21910 __tmp.put_f32_le(self.flow_rate_y);
21911 if matches!(version, MavlinkVersion::V2) {
21912 let len = __tmp.len();
21913 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21914 } else {
21915 __tmp.len()
21916 }
21917 }
21918}
21919#[doc = "id: 106"]
21920#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
21921#[derive(Debug, Clone, PartialEq)]
21922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21924pub struct OPTICAL_FLOW_RAD_DATA {
21925 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21926 pub time_usec: u64,
21927 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
21928 pub integration_time_us: u32,
21929 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
21930 pub integrated_x: f32,
21931 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
21932 pub integrated_y: f32,
21933 #[doc = "RH rotation around X axis"]
21934 pub integrated_xgyro: f32,
21935 #[doc = "RH rotation around Y axis"]
21936 pub integrated_ygyro: f32,
21937 #[doc = "RH rotation around Z axis"]
21938 pub integrated_zgyro: f32,
21939 #[doc = "Time since the distance was sampled."]
21940 pub time_delta_distance_us: u32,
21941 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
21942 pub distance: f32,
21943 #[doc = "Temperature"]
21944 pub temperature: i16,
21945 #[doc = "Sensor ID"]
21946 pub sensor_id: u8,
21947 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
21948 pub quality: u8,
21949}
21950impl OPTICAL_FLOW_RAD_DATA {
21951 pub const ENCODED_LEN: usize = 44usize;
21952 pub const DEFAULT: Self = Self {
21953 time_usec: 0_u64,
21954 integration_time_us: 0_u32,
21955 integrated_x: 0.0_f32,
21956 integrated_y: 0.0_f32,
21957 integrated_xgyro: 0.0_f32,
21958 integrated_ygyro: 0.0_f32,
21959 integrated_zgyro: 0.0_f32,
21960 time_delta_distance_us: 0_u32,
21961 distance: 0.0_f32,
21962 temperature: 0_i16,
21963 sensor_id: 0_u8,
21964 quality: 0_u8,
21965 };
21966 #[cfg(feature = "arbitrary")]
21967 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21968 use arbitrary::{Arbitrary, Unstructured};
21969 let mut buf = [0u8; 1024];
21970 rng.fill_bytes(&mut buf);
21971 let mut unstructured = Unstructured::new(&buf);
21972 Self::arbitrary(&mut unstructured).unwrap_or_default()
21973 }
21974}
21975impl Default for OPTICAL_FLOW_RAD_DATA {
21976 fn default() -> Self {
21977 Self::DEFAULT.clone()
21978 }
21979}
21980impl MessageData for OPTICAL_FLOW_RAD_DATA {
21981 type Message = MavMessage;
21982 const ID: u32 = 106u32;
21983 const NAME: &'static str = "OPTICAL_FLOW_RAD";
21984 const EXTRA_CRC: u8 = 138u8;
21985 const ENCODED_LEN: usize = 44usize;
21986 fn deser(
21987 _version: MavlinkVersion,
21988 __input: &[u8],
21989 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21990 let avail_len = __input.len();
21991 let mut payload_buf = [0; Self::ENCODED_LEN];
21992 let mut buf = if avail_len < Self::ENCODED_LEN {
21993 payload_buf[0..avail_len].copy_from_slice(__input);
21994 Bytes::new(&payload_buf)
21995 } else {
21996 Bytes::new(__input)
21997 };
21998 let mut __struct = Self::default();
21999 __struct.time_usec = buf.get_u64_le();
22000 __struct.integration_time_us = buf.get_u32_le();
22001 __struct.integrated_x = buf.get_f32_le();
22002 __struct.integrated_y = buf.get_f32_le();
22003 __struct.integrated_xgyro = buf.get_f32_le();
22004 __struct.integrated_ygyro = buf.get_f32_le();
22005 __struct.integrated_zgyro = buf.get_f32_le();
22006 __struct.time_delta_distance_us = buf.get_u32_le();
22007 __struct.distance = buf.get_f32_le();
22008 __struct.temperature = buf.get_i16_le();
22009 __struct.sensor_id = buf.get_u8();
22010 __struct.quality = buf.get_u8();
22011 Ok(__struct)
22012 }
22013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22014 let mut __tmp = BytesMut::new(bytes);
22015 #[allow(clippy::absurd_extreme_comparisons)]
22016 #[allow(unused_comparisons)]
22017 if __tmp.remaining() < Self::ENCODED_LEN {
22018 panic!(
22019 "buffer is too small (need {} bytes, but got {})",
22020 Self::ENCODED_LEN,
22021 __tmp.remaining(),
22022 )
22023 }
22024 __tmp.put_u64_le(self.time_usec);
22025 __tmp.put_u32_le(self.integration_time_us);
22026 __tmp.put_f32_le(self.integrated_x);
22027 __tmp.put_f32_le(self.integrated_y);
22028 __tmp.put_f32_le(self.integrated_xgyro);
22029 __tmp.put_f32_le(self.integrated_ygyro);
22030 __tmp.put_f32_le(self.integrated_zgyro);
22031 __tmp.put_u32_le(self.time_delta_distance_us);
22032 __tmp.put_f32_le(self.distance);
22033 __tmp.put_i16_le(self.temperature);
22034 __tmp.put_u8(self.sensor_id);
22035 __tmp.put_u8(self.quality);
22036 if matches!(version, MavlinkVersion::V2) {
22037 let len = __tmp.len();
22038 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22039 } else {
22040 __tmp.len()
22041 }
22042 }
22043}
22044#[doc = "id: 360"]
22045#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22046#[derive(Debug, Clone, PartialEq)]
22047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22049pub struct ORBIT_EXECUTION_STATUS_DATA {
22050 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22051 pub time_usec: u64,
22052 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22053 pub radius: f32,
22054 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22055 pub x: i32,
22056 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22057 pub y: i32,
22058 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22059 pub z: f32,
22060 #[doc = "The coordinate system of the fields: x, y, z."]
22061 pub frame: MavFrame,
22062}
22063impl ORBIT_EXECUTION_STATUS_DATA {
22064 pub const ENCODED_LEN: usize = 25usize;
22065 pub const DEFAULT: Self = Self {
22066 time_usec: 0_u64,
22067 radius: 0.0_f32,
22068 x: 0_i32,
22069 y: 0_i32,
22070 z: 0.0_f32,
22071 frame: MavFrame::DEFAULT,
22072 };
22073 #[cfg(feature = "arbitrary")]
22074 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22075 use arbitrary::{Arbitrary, Unstructured};
22076 let mut buf = [0u8; 1024];
22077 rng.fill_bytes(&mut buf);
22078 let mut unstructured = Unstructured::new(&buf);
22079 Self::arbitrary(&mut unstructured).unwrap_or_default()
22080 }
22081}
22082impl Default for ORBIT_EXECUTION_STATUS_DATA {
22083 fn default() -> Self {
22084 Self::DEFAULT.clone()
22085 }
22086}
22087impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22088 type Message = MavMessage;
22089 const ID: u32 = 360u32;
22090 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22091 const EXTRA_CRC: u8 = 11u8;
22092 const ENCODED_LEN: usize = 25usize;
22093 fn deser(
22094 _version: MavlinkVersion,
22095 __input: &[u8],
22096 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22097 let avail_len = __input.len();
22098 let mut payload_buf = [0; Self::ENCODED_LEN];
22099 let mut buf = if avail_len < Self::ENCODED_LEN {
22100 payload_buf[0..avail_len].copy_from_slice(__input);
22101 Bytes::new(&payload_buf)
22102 } else {
22103 Bytes::new(__input)
22104 };
22105 let mut __struct = Self::default();
22106 __struct.time_usec = buf.get_u64_le();
22107 __struct.radius = buf.get_f32_le();
22108 __struct.x = buf.get_i32_le();
22109 __struct.y = buf.get_i32_le();
22110 __struct.z = buf.get_f32_le();
22111 let tmp = buf.get_u8();
22112 __struct.frame =
22113 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22114 enum_type: "MavFrame",
22115 value: tmp as u32,
22116 })?;
22117 Ok(__struct)
22118 }
22119 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22120 let mut __tmp = BytesMut::new(bytes);
22121 #[allow(clippy::absurd_extreme_comparisons)]
22122 #[allow(unused_comparisons)]
22123 if __tmp.remaining() < Self::ENCODED_LEN {
22124 panic!(
22125 "buffer is too small (need {} bytes, but got {})",
22126 Self::ENCODED_LEN,
22127 __tmp.remaining(),
22128 )
22129 }
22130 __tmp.put_u64_le(self.time_usec);
22131 __tmp.put_f32_le(self.radius);
22132 __tmp.put_i32_le(self.x);
22133 __tmp.put_i32_le(self.y);
22134 __tmp.put_f32_le(self.z);
22135 __tmp.put_u8(self.frame as u8);
22136 if matches!(version, MavlinkVersion::V2) {
22137 let len = __tmp.len();
22138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22139 } else {
22140 __tmp.len()
22141 }
22142 }
22143}
22144#[doc = "id: 324"]
22145#[doc = "Response from a PARAM_EXT_SET message."]
22146#[derive(Debug, Clone, PartialEq)]
22147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22149pub struct PARAM_EXT_ACK_DATA {
22150 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22151 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22152 pub param_id: [u8; 16],
22153 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
22154 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22155 pub param_value: [u8; 128],
22156 #[doc = "Parameter type."]
22157 pub param_type: MavParamExtType,
22158 #[doc = "Result code."]
22159 pub param_result: ParamAck,
22160}
22161impl PARAM_EXT_ACK_DATA {
22162 pub const ENCODED_LEN: usize = 146usize;
22163 pub const DEFAULT: Self = Self {
22164 param_id: [0_u8; 16usize],
22165 param_value: [0_u8; 128usize],
22166 param_type: MavParamExtType::DEFAULT,
22167 param_result: ParamAck::DEFAULT,
22168 };
22169 #[cfg(feature = "arbitrary")]
22170 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22171 use arbitrary::{Arbitrary, Unstructured};
22172 let mut buf = [0u8; 1024];
22173 rng.fill_bytes(&mut buf);
22174 let mut unstructured = Unstructured::new(&buf);
22175 Self::arbitrary(&mut unstructured).unwrap_or_default()
22176 }
22177}
22178impl Default for PARAM_EXT_ACK_DATA {
22179 fn default() -> Self {
22180 Self::DEFAULT.clone()
22181 }
22182}
22183impl MessageData for PARAM_EXT_ACK_DATA {
22184 type Message = MavMessage;
22185 const ID: u32 = 324u32;
22186 const NAME: &'static str = "PARAM_EXT_ACK";
22187 const EXTRA_CRC: u8 = 132u8;
22188 const ENCODED_LEN: usize = 146usize;
22189 fn deser(
22190 _version: MavlinkVersion,
22191 __input: &[u8],
22192 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22193 let avail_len = __input.len();
22194 let mut payload_buf = [0; Self::ENCODED_LEN];
22195 let mut buf = if avail_len < Self::ENCODED_LEN {
22196 payload_buf[0..avail_len].copy_from_slice(__input);
22197 Bytes::new(&payload_buf)
22198 } else {
22199 Bytes::new(__input)
22200 };
22201 let mut __struct = Self::default();
22202 for v in &mut __struct.param_id {
22203 let val = buf.get_u8();
22204 *v = val;
22205 }
22206 for v in &mut __struct.param_value {
22207 let val = buf.get_u8();
22208 *v = val;
22209 }
22210 let tmp = buf.get_u8();
22211 __struct.param_type =
22212 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22213 enum_type: "MavParamExtType",
22214 value: tmp as u32,
22215 })?;
22216 let tmp = buf.get_u8();
22217 __struct.param_result =
22218 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22219 enum_type: "ParamAck",
22220 value: tmp as u32,
22221 })?;
22222 Ok(__struct)
22223 }
22224 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22225 let mut __tmp = BytesMut::new(bytes);
22226 #[allow(clippy::absurd_extreme_comparisons)]
22227 #[allow(unused_comparisons)]
22228 if __tmp.remaining() < Self::ENCODED_LEN {
22229 panic!(
22230 "buffer is too small (need {} bytes, but got {})",
22231 Self::ENCODED_LEN,
22232 __tmp.remaining(),
22233 )
22234 }
22235 for val in &self.param_id {
22236 __tmp.put_u8(*val);
22237 }
22238 for val in &self.param_value {
22239 __tmp.put_u8(*val);
22240 }
22241 __tmp.put_u8(self.param_type as u8);
22242 __tmp.put_u8(self.param_result as u8);
22243 if matches!(version, MavlinkVersion::V2) {
22244 let len = __tmp.len();
22245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22246 } else {
22247 __tmp.len()
22248 }
22249 }
22250}
22251#[doc = "id: 321"]
22252#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
22253#[derive(Debug, Clone, PartialEq)]
22254#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22256pub struct PARAM_EXT_REQUEST_LIST_DATA {
22257 #[doc = "System ID"]
22258 pub target_system: u8,
22259 #[doc = "Component ID"]
22260 pub target_component: u8,
22261}
22262impl PARAM_EXT_REQUEST_LIST_DATA {
22263 pub const ENCODED_LEN: usize = 2usize;
22264 pub const DEFAULT: Self = Self {
22265 target_system: 0_u8,
22266 target_component: 0_u8,
22267 };
22268 #[cfg(feature = "arbitrary")]
22269 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22270 use arbitrary::{Arbitrary, Unstructured};
22271 let mut buf = [0u8; 1024];
22272 rng.fill_bytes(&mut buf);
22273 let mut unstructured = Unstructured::new(&buf);
22274 Self::arbitrary(&mut unstructured).unwrap_or_default()
22275 }
22276}
22277impl Default for PARAM_EXT_REQUEST_LIST_DATA {
22278 fn default() -> Self {
22279 Self::DEFAULT.clone()
22280 }
22281}
22282impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
22283 type Message = MavMessage;
22284 const ID: u32 = 321u32;
22285 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
22286 const EXTRA_CRC: u8 = 88u8;
22287 const ENCODED_LEN: usize = 2usize;
22288 fn deser(
22289 _version: MavlinkVersion,
22290 __input: &[u8],
22291 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22292 let avail_len = __input.len();
22293 let mut payload_buf = [0; Self::ENCODED_LEN];
22294 let mut buf = if avail_len < Self::ENCODED_LEN {
22295 payload_buf[0..avail_len].copy_from_slice(__input);
22296 Bytes::new(&payload_buf)
22297 } else {
22298 Bytes::new(__input)
22299 };
22300 let mut __struct = Self::default();
22301 __struct.target_system = buf.get_u8();
22302 __struct.target_component = buf.get_u8();
22303 Ok(__struct)
22304 }
22305 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22306 let mut __tmp = BytesMut::new(bytes);
22307 #[allow(clippy::absurd_extreme_comparisons)]
22308 #[allow(unused_comparisons)]
22309 if __tmp.remaining() < Self::ENCODED_LEN {
22310 panic!(
22311 "buffer is too small (need {} bytes, but got {})",
22312 Self::ENCODED_LEN,
22313 __tmp.remaining(),
22314 )
22315 }
22316 __tmp.put_u8(self.target_system);
22317 __tmp.put_u8(self.target_component);
22318 if matches!(version, MavlinkVersion::V2) {
22319 let len = __tmp.len();
22320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22321 } else {
22322 __tmp.len()
22323 }
22324 }
22325}
22326#[doc = "id: 320"]
22327#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
22328#[derive(Debug, Clone, PartialEq)]
22329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22331pub struct PARAM_EXT_REQUEST_READ_DATA {
22332 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
22333 pub param_index: i16,
22334 #[doc = "System ID"]
22335 pub target_system: u8,
22336 #[doc = "Component ID"]
22337 pub target_component: u8,
22338 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22339 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22340 pub param_id: [u8; 16],
22341}
22342impl PARAM_EXT_REQUEST_READ_DATA {
22343 pub const ENCODED_LEN: usize = 20usize;
22344 pub const DEFAULT: Self = Self {
22345 param_index: 0_i16,
22346 target_system: 0_u8,
22347 target_component: 0_u8,
22348 param_id: [0_u8; 16usize],
22349 };
22350 #[cfg(feature = "arbitrary")]
22351 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22352 use arbitrary::{Arbitrary, Unstructured};
22353 let mut buf = [0u8; 1024];
22354 rng.fill_bytes(&mut buf);
22355 let mut unstructured = Unstructured::new(&buf);
22356 Self::arbitrary(&mut unstructured).unwrap_or_default()
22357 }
22358}
22359impl Default for PARAM_EXT_REQUEST_READ_DATA {
22360 fn default() -> Self {
22361 Self::DEFAULT.clone()
22362 }
22363}
22364impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
22365 type Message = MavMessage;
22366 const ID: u32 = 320u32;
22367 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
22368 const EXTRA_CRC: u8 = 243u8;
22369 const ENCODED_LEN: usize = 20usize;
22370 fn deser(
22371 _version: MavlinkVersion,
22372 __input: &[u8],
22373 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22374 let avail_len = __input.len();
22375 let mut payload_buf = [0; Self::ENCODED_LEN];
22376 let mut buf = if avail_len < Self::ENCODED_LEN {
22377 payload_buf[0..avail_len].copy_from_slice(__input);
22378 Bytes::new(&payload_buf)
22379 } else {
22380 Bytes::new(__input)
22381 };
22382 let mut __struct = Self::default();
22383 __struct.param_index = buf.get_i16_le();
22384 __struct.target_system = buf.get_u8();
22385 __struct.target_component = buf.get_u8();
22386 for v in &mut __struct.param_id {
22387 let val = buf.get_u8();
22388 *v = val;
22389 }
22390 Ok(__struct)
22391 }
22392 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22393 let mut __tmp = BytesMut::new(bytes);
22394 #[allow(clippy::absurd_extreme_comparisons)]
22395 #[allow(unused_comparisons)]
22396 if __tmp.remaining() < Self::ENCODED_LEN {
22397 panic!(
22398 "buffer is too small (need {} bytes, but got {})",
22399 Self::ENCODED_LEN,
22400 __tmp.remaining(),
22401 )
22402 }
22403 __tmp.put_i16_le(self.param_index);
22404 __tmp.put_u8(self.target_system);
22405 __tmp.put_u8(self.target_component);
22406 for val in &self.param_id {
22407 __tmp.put_u8(*val);
22408 }
22409 if matches!(version, MavlinkVersion::V2) {
22410 let len = __tmp.len();
22411 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22412 } else {
22413 __tmp.len()
22414 }
22415 }
22416}
22417#[doc = "id: 323"]
22418#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
22419#[derive(Debug, Clone, PartialEq)]
22420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22422pub struct PARAM_EXT_SET_DATA {
22423 #[doc = "System ID"]
22424 pub target_system: u8,
22425 #[doc = "Component ID"]
22426 pub target_component: u8,
22427 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22428 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22429 pub param_id: [u8; 16],
22430 #[doc = "Parameter value"]
22431 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22432 pub param_value: [u8; 128],
22433 #[doc = "Parameter type."]
22434 pub param_type: MavParamExtType,
22435}
22436impl PARAM_EXT_SET_DATA {
22437 pub const ENCODED_LEN: usize = 147usize;
22438 pub const DEFAULT: Self = Self {
22439 target_system: 0_u8,
22440 target_component: 0_u8,
22441 param_id: [0_u8; 16usize],
22442 param_value: [0_u8; 128usize],
22443 param_type: MavParamExtType::DEFAULT,
22444 };
22445 #[cfg(feature = "arbitrary")]
22446 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22447 use arbitrary::{Arbitrary, Unstructured};
22448 let mut buf = [0u8; 1024];
22449 rng.fill_bytes(&mut buf);
22450 let mut unstructured = Unstructured::new(&buf);
22451 Self::arbitrary(&mut unstructured).unwrap_or_default()
22452 }
22453}
22454impl Default for PARAM_EXT_SET_DATA {
22455 fn default() -> Self {
22456 Self::DEFAULT.clone()
22457 }
22458}
22459impl MessageData for PARAM_EXT_SET_DATA {
22460 type Message = MavMessage;
22461 const ID: u32 = 323u32;
22462 const NAME: &'static str = "PARAM_EXT_SET";
22463 const EXTRA_CRC: u8 = 78u8;
22464 const ENCODED_LEN: usize = 147usize;
22465 fn deser(
22466 _version: MavlinkVersion,
22467 __input: &[u8],
22468 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22469 let avail_len = __input.len();
22470 let mut payload_buf = [0; Self::ENCODED_LEN];
22471 let mut buf = if avail_len < Self::ENCODED_LEN {
22472 payload_buf[0..avail_len].copy_from_slice(__input);
22473 Bytes::new(&payload_buf)
22474 } else {
22475 Bytes::new(__input)
22476 };
22477 let mut __struct = Self::default();
22478 __struct.target_system = buf.get_u8();
22479 __struct.target_component = buf.get_u8();
22480 for v in &mut __struct.param_id {
22481 let val = buf.get_u8();
22482 *v = val;
22483 }
22484 for v in &mut __struct.param_value {
22485 let val = buf.get_u8();
22486 *v = val;
22487 }
22488 let tmp = buf.get_u8();
22489 __struct.param_type =
22490 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22491 enum_type: "MavParamExtType",
22492 value: tmp as u32,
22493 })?;
22494 Ok(__struct)
22495 }
22496 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22497 let mut __tmp = BytesMut::new(bytes);
22498 #[allow(clippy::absurd_extreme_comparisons)]
22499 #[allow(unused_comparisons)]
22500 if __tmp.remaining() < Self::ENCODED_LEN {
22501 panic!(
22502 "buffer is too small (need {} bytes, but got {})",
22503 Self::ENCODED_LEN,
22504 __tmp.remaining(),
22505 )
22506 }
22507 __tmp.put_u8(self.target_system);
22508 __tmp.put_u8(self.target_component);
22509 for val in &self.param_id {
22510 __tmp.put_u8(*val);
22511 }
22512 for val in &self.param_value {
22513 __tmp.put_u8(*val);
22514 }
22515 __tmp.put_u8(self.param_type as u8);
22516 if matches!(version, MavlinkVersion::V2) {
22517 let len = __tmp.len();
22518 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22519 } else {
22520 __tmp.len()
22521 }
22522 }
22523}
22524#[doc = "id: 322"]
22525#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
22526#[derive(Debug, Clone, PartialEq)]
22527#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22528#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22529pub struct PARAM_EXT_VALUE_DATA {
22530 #[doc = "Total number of parameters"]
22531 pub param_count: u16,
22532 #[doc = "Index of this parameter"]
22533 pub param_index: u16,
22534 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22535 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22536 pub param_id: [u8; 16],
22537 #[doc = "Parameter value"]
22538 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22539 pub param_value: [u8; 128],
22540 #[doc = "Parameter type."]
22541 pub param_type: MavParamExtType,
22542}
22543impl PARAM_EXT_VALUE_DATA {
22544 pub const ENCODED_LEN: usize = 149usize;
22545 pub const DEFAULT: Self = Self {
22546 param_count: 0_u16,
22547 param_index: 0_u16,
22548 param_id: [0_u8; 16usize],
22549 param_value: [0_u8; 128usize],
22550 param_type: MavParamExtType::DEFAULT,
22551 };
22552 #[cfg(feature = "arbitrary")]
22553 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22554 use arbitrary::{Arbitrary, Unstructured};
22555 let mut buf = [0u8; 1024];
22556 rng.fill_bytes(&mut buf);
22557 let mut unstructured = Unstructured::new(&buf);
22558 Self::arbitrary(&mut unstructured).unwrap_or_default()
22559 }
22560}
22561impl Default for PARAM_EXT_VALUE_DATA {
22562 fn default() -> Self {
22563 Self::DEFAULT.clone()
22564 }
22565}
22566impl MessageData for PARAM_EXT_VALUE_DATA {
22567 type Message = MavMessage;
22568 const ID: u32 = 322u32;
22569 const NAME: &'static str = "PARAM_EXT_VALUE";
22570 const EXTRA_CRC: u8 = 243u8;
22571 const ENCODED_LEN: usize = 149usize;
22572 fn deser(
22573 _version: MavlinkVersion,
22574 __input: &[u8],
22575 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22576 let avail_len = __input.len();
22577 let mut payload_buf = [0; Self::ENCODED_LEN];
22578 let mut buf = if avail_len < Self::ENCODED_LEN {
22579 payload_buf[0..avail_len].copy_from_slice(__input);
22580 Bytes::new(&payload_buf)
22581 } else {
22582 Bytes::new(__input)
22583 };
22584 let mut __struct = Self::default();
22585 __struct.param_count = buf.get_u16_le();
22586 __struct.param_index = buf.get_u16_le();
22587 for v in &mut __struct.param_id {
22588 let val = buf.get_u8();
22589 *v = val;
22590 }
22591 for v in &mut __struct.param_value {
22592 let val = buf.get_u8();
22593 *v = val;
22594 }
22595 let tmp = buf.get_u8();
22596 __struct.param_type =
22597 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22598 enum_type: "MavParamExtType",
22599 value: tmp as u32,
22600 })?;
22601 Ok(__struct)
22602 }
22603 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22604 let mut __tmp = BytesMut::new(bytes);
22605 #[allow(clippy::absurd_extreme_comparisons)]
22606 #[allow(unused_comparisons)]
22607 if __tmp.remaining() < Self::ENCODED_LEN {
22608 panic!(
22609 "buffer is too small (need {} bytes, but got {})",
22610 Self::ENCODED_LEN,
22611 __tmp.remaining(),
22612 )
22613 }
22614 __tmp.put_u16_le(self.param_count);
22615 __tmp.put_u16_le(self.param_index);
22616 for val in &self.param_id {
22617 __tmp.put_u8(*val);
22618 }
22619 for val in &self.param_value {
22620 __tmp.put_u8(*val);
22621 }
22622 __tmp.put_u8(self.param_type as u8);
22623 if matches!(version, MavlinkVersion::V2) {
22624 let len = __tmp.len();
22625 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22626 } else {
22627 __tmp.len()
22628 }
22629 }
22630}
22631#[doc = "id: 50"]
22632#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
22633#[derive(Debug, Clone, PartialEq)]
22634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22636pub struct PARAM_MAP_RC_DATA {
22637 #[doc = "Initial parameter value"]
22638 pub param_value0: f32,
22639 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
22640 pub scale: f32,
22641 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
22642 pub param_value_min: f32,
22643 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
22644 pub param_value_max: f32,
22645 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
22646 pub param_index: i16,
22647 #[doc = "System ID"]
22648 pub target_system: u8,
22649 #[doc = "Component ID"]
22650 pub target_component: u8,
22651 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22652 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22653 pub param_id: [u8; 16],
22654 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
22655 pub parameter_rc_channel_index: u8,
22656}
22657impl PARAM_MAP_RC_DATA {
22658 pub const ENCODED_LEN: usize = 37usize;
22659 pub const DEFAULT: Self = Self {
22660 param_value0: 0.0_f32,
22661 scale: 0.0_f32,
22662 param_value_min: 0.0_f32,
22663 param_value_max: 0.0_f32,
22664 param_index: 0_i16,
22665 target_system: 0_u8,
22666 target_component: 0_u8,
22667 param_id: [0_u8; 16usize],
22668 parameter_rc_channel_index: 0_u8,
22669 };
22670 #[cfg(feature = "arbitrary")]
22671 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22672 use arbitrary::{Arbitrary, Unstructured};
22673 let mut buf = [0u8; 1024];
22674 rng.fill_bytes(&mut buf);
22675 let mut unstructured = Unstructured::new(&buf);
22676 Self::arbitrary(&mut unstructured).unwrap_or_default()
22677 }
22678}
22679impl Default for PARAM_MAP_RC_DATA {
22680 fn default() -> Self {
22681 Self::DEFAULT.clone()
22682 }
22683}
22684impl MessageData for PARAM_MAP_RC_DATA {
22685 type Message = MavMessage;
22686 const ID: u32 = 50u32;
22687 const NAME: &'static str = "PARAM_MAP_RC";
22688 const EXTRA_CRC: u8 = 78u8;
22689 const ENCODED_LEN: usize = 37usize;
22690 fn deser(
22691 _version: MavlinkVersion,
22692 __input: &[u8],
22693 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22694 let avail_len = __input.len();
22695 let mut payload_buf = [0; Self::ENCODED_LEN];
22696 let mut buf = if avail_len < Self::ENCODED_LEN {
22697 payload_buf[0..avail_len].copy_from_slice(__input);
22698 Bytes::new(&payload_buf)
22699 } else {
22700 Bytes::new(__input)
22701 };
22702 let mut __struct = Self::default();
22703 __struct.param_value0 = buf.get_f32_le();
22704 __struct.scale = buf.get_f32_le();
22705 __struct.param_value_min = buf.get_f32_le();
22706 __struct.param_value_max = buf.get_f32_le();
22707 __struct.param_index = buf.get_i16_le();
22708 __struct.target_system = buf.get_u8();
22709 __struct.target_component = buf.get_u8();
22710 for v in &mut __struct.param_id {
22711 let val = buf.get_u8();
22712 *v = val;
22713 }
22714 __struct.parameter_rc_channel_index = buf.get_u8();
22715 Ok(__struct)
22716 }
22717 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22718 let mut __tmp = BytesMut::new(bytes);
22719 #[allow(clippy::absurd_extreme_comparisons)]
22720 #[allow(unused_comparisons)]
22721 if __tmp.remaining() < Self::ENCODED_LEN {
22722 panic!(
22723 "buffer is too small (need {} bytes, but got {})",
22724 Self::ENCODED_LEN,
22725 __tmp.remaining(),
22726 )
22727 }
22728 __tmp.put_f32_le(self.param_value0);
22729 __tmp.put_f32_le(self.scale);
22730 __tmp.put_f32_le(self.param_value_min);
22731 __tmp.put_f32_le(self.param_value_max);
22732 __tmp.put_i16_le(self.param_index);
22733 __tmp.put_u8(self.target_system);
22734 __tmp.put_u8(self.target_component);
22735 for val in &self.param_id {
22736 __tmp.put_u8(*val);
22737 }
22738 __tmp.put_u8(self.parameter_rc_channel_index);
22739 if matches!(version, MavlinkVersion::V2) {
22740 let len = __tmp.len();
22741 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22742 } else {
22743 __tmp.len()
22744 }
22745 }
22746}
22747#[doc = "id: 21"]
22748#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
22749#[derive(Debug, Clone, PartialEq)]
22750#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22751#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22752pub struct PARAM_REQUEST_LIST_DATA {
22753 #[doc = "System ID"]
22754 pub target_system: u8,
22755 #[doc = "Component ID"]
22756 pub target_component: u8,
22757}
22758impl PARAM_REQUEST_LIST_DATA {
22759 pub const ENCODED_LEN: usize = 2usize;
22760 pub const DEFAULT: Self = Self {
22761 target_system: 0_u8,
22762 target_component: 0_u8,
22763 };
22764 #[cfg(feature = "arbitrary")]
22765 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22766 use arbitrary::{Arbitrary, Unstructured};
22767 let mut buf = [0u8; 1024];
22768 rng.fill_bytes(&mut buf);
22769 let mut unstructured = Unstructured::new(&buf);
22770 Self::arbitrary(&mut unstructured).unwrap_or_default()
22771 }
22772}
22773impl Default for PARAM_REQUEST_LIST_DATA {
22774 fn default() -> Self {
22775 Self::DEFAULT.clone()
22776 }
22777}
22778impl MessageData for PARAM_REQUEST_LIST_DATA {
22779 type Message = MavMessage;
22780 const ID: u32 = 21u32;
22781 const NAME: &'static str = "PARAM_REQUEST_LIST";
22782 const EXTRA_CRC: u8 = 159u8;
22783 const ENCODED_LEN: usize = 2usize;
22784 fn deser(
22785 _version: MavlinkVersion,
22786 __input: &[u8],
22787 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22788 let avail_len = __input.len();
22789 let mut payload_buf = [0; Self::ENCODED_LEN];
22790 let mut buf = if avail_len < Self::ENCODED_LEN {
22791 payload_buf[0..avail_len].copy_from_slice(__input);
22792 Bytes::new(&payload_buf)
22793 } else {
22794 Bytes::new(__input)
22795 };
22796 let mut __struct = Self::default();
22797 __struct.target_system = buf.get_u8();
22798 __struct.target_component = buf.get_u8();
22799 Ok(__struct)
22800 }
22801 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22802 let mut __tmp = BytesMut::new(bytes);
22803 #[allow(clippy::absurd_extreme_comparisons)]
22804 #[allow(unused_comparisons)]
22805 if __tmp.remaining() < Self::ENCODED_LEN {
22806 panic!(
22807 "buffer is too small (need {} bytes, but got {})",
22808 Self::ENCODED_LEN,
22809 __tmp.remaining(),
22810 )
22811 }
22812 __tmp.put_u8(self.target_system);
22813 __tmp.put_u8(self.target_component);
22814 if matches!(version, MavlinkVersion::V2) {
22815 let len = __tmp.len();
22816 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22817 } else {
22818 __tmp.len()
22819 }
22820 }
22821}
22822#[doc = "id: 20"]
22823#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
22824#[derive(Debug, Clone, PartialEq)]
22825#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22827pub struct PARAM_REQUEST_READ_DATA {
22828 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
22829 pub param_index: i16,
22830 #[doc = "System ID"]
22831 pub target_system: u8,
22832 #[doc = "Component ID"]
22833 pub target_component: u8,
22834 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22835 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22836 pub param_id: [u8; 16],
22837}
22838impl PARAM_REQUEST_READ_DATA {
22839 pub const ENCODED_LEN: usize = 20usize;
22840 pub const DEFAULT: Self = Self {
22841 param_index: 0_i16,
22842 target_system: 0_u8,
22843 target_component: 0_u8,
22844 param_id: [0_u8; 16usize],
22845 };
22846 #[cfg(feature = "arbitrary")]
22847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22848 use arbitrary::{Arbitrary, Unstructured};
22849 let mut buf = [0u8; 1024];
22850 rng.fill_bytes(&mut buf);
22851 let mut unstructured = Unstructured::new(&buf);
22852 Self::arbitrary(&mut unstructured).unwrap_or_default()
22853 }
22854}
22855impl Default for PARAM_REQUEST_READ_DATA {
22856 fn default() -> Self {
22857 Self::DEFAULT.clone()
22858 }
22859}
22860impl MessageData for PARAM_REQUEST_READ_DATA {
22861 type Message = MavMessage;
22862 const ID: u32 = 20u32;
22863 const NAME: &'static str = "PARAM_REQUEST_READ";
22864 const EXTRA_CRC: u8 = 214u8;
22865 const ENCODED_LEN: usize = 20usize;
22866 fn deser(
22867 _version: MavlinkVersion,
22868 __input: &[u8],
22869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22870 let avail_len = __input.len();
22871 let mut payload_buf = [0; Self::ENCODED_LEN];
22872 let mut buf = if avail_len < Self::ENCODED_LEN {
22873 payload_buf[0..avail_len].copy_from_slice(__input);
22874 Bytes::new(&payload_buf)
22875 } else {
22876 Bytes::new(__input)
22877 };
22878 let mut __struct = Self::default();
22879 __struct.param_index = buf.get_i16_le();
22880 __struct.target_system = buf.get_u8();
22881 __struct.target_component = buf.get_u8();
22882 for v in &mut __struct.param_id {
22883 let val = buf.get_u8();
22884 *v = val;
22885 }
22886 Ok(__struct)
22887 }
22888 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22889 let mut __tmp = BytesMut::new(bytes);
22890 #[allow(clippy::absurd_extreme_comparisons)]
22891 #[allow(unused_comparisons)]
22892 if __tmp.remaining() < Self::ENCODED_LEN {
22893 panic!(
22894 "buffer is too small (need {} bytes, but got {})",
22895 Self::ENCODED_LEN,
22896 __tmp.remaining(),
22897 )
22898 }
22899 __tmp.put_i16_le(self.param_index);
22900 __tmp.put_u8(self.target_system);
22901 __tmp.put_u8(self.target_component);
22902 for val in &self.param_id {
22903 __tmp.put_u8(*val);
22904 }
22905 if matches!(version, MavlinkVersion::V2) {
22906 let len = __tmp.len();
22907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22908 } else {
22909 __tmp.len()
22910 }
22911 }
22912}
22913#[doc = "id: 23"]
22914#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
22915#[derive(Debug, Clone, PartialEq)]
22916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22918pub struct PARAM_SET_DATA {
22919 #[doc = "Onboard parameter value"]
22920 pub param_value: f32,
22921 #[doc = "System ID"]
22922 pub target_system: u8,
22923 #[doc = "Component ID"]
22924 pub target_component: u8,
22925 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22926 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22927 pub param_id: [u8; 16],
22928 #[doc = "Onboard parameter type."]
22929 pub param_type: MavParamType,
22930}
22931impl PARAM_SET_DATA {
22932 pub const ENCODED_LEN: usize = 23usize;
22933 pub const DEFAULT: Self = Self {
22934 param_value: 0.0_f32,
22935 target_system: 0_u8,
22936 target_component: 0_u8,
22937 param_id: [0_u8; 16usize],
22938 param_type: MavParamType::DEFAULT,
22939 };
22940 #[cfg(feature = "arbitrary")]
22941 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22942 use arbitrary::{Arbitrary, Unstructured};
22943 let mut buf = [0u8; 1024];
22944 rng.fill_bytes(&mut buf);
22945 let mut unstructured = Unstructured::new(&buf);
22946 Self::arbitrary(&mut unstructured).unwrap_or_default()
22947 }
22948}
22949impl Default for PARAM_SET_DATA {
22950 fn default() -> Self {
22951 Self::DEFAULT.clone()
22952 }
22953}
22954impl MessageData for PARAM_SET_DATA {
22955 type Message = MavMessage;
22956 const ID: u32 = 23u32;
22957 const NAME: &'static str = "PARAM_SET";
22958 const EXTRA_CRC: u8 = 168u8;
22959 const ENCODED_LEN: usize = 23usize;
22960 fn deser(
22961 _version: MavlinkVersion,
22962 __input: &[u8],
22963 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22964 let avail_len = __input.len();
22965 let mut payload_buf = [0; Self::ENCODED_LEN];
22966 let mut buf = if avail_len < Self::ENCODED_LEN {
22967 payload_buf[0..avail_len].copy_from_slice(__input);
22968 Bytes::new(&payload_buf)
22969 } else {
22970 Bytes::new(__input)
22971 };
22972 let mut __struct = Self::default();
22973 __struct.param_value = buf.get_f32_le();
22974 __struct.target_system = buf.get_u8();
22975 __struct.target_component = buf.get_u8();
22976 for v in &mut __struct.param_id {
22977 let val = buf.get_u8();
22978 *v = val;
22979 }
22980 let tmp = buf.get_u8();
22981 __struct.param_type =
22982 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22983 enum_type: "MavParamType",
22984 value: tmp as u32,
22985 })?;
22986 Ok(__struct)
22987 }
22988 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22989 let mut __tmp = BytesMut::new(bytes);
22990 #[allow(clippy::absurd_extreme_comparisons)]
22991 #[allow(unused_comparisons)]
22992 if __tmp.remaining() < Self::ENCODED_LEN {
22993 panic!(
22994 "buffer is too small (need {} bytes, but got {})",
22995 Self::ENCODED_LEN,
22996 __tmp.remaining(),
22997 )
22998 }
22999 __tmp.put_f32_le(self.param_value);
23000 __tmp.put_u8(self.target_system);
23001 __tmp.put_u8(self.target_component);
23002 for val in &self.param_id {
23003 __tmp.put_u8(*val);
23004 }
23005 __tmp.put_u8(self.param_type as u8);
23006 if matches!(version, MavlinkVersion::V2) {
23007 let len = __tmp.len();
23008 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23009 } else {
23010 __tmp.len()
23011 }
23012 }
23013}
23014#[doc = "id: 22"]
23015#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23016#[derive(Debug, Clone, PartialEq)]
23017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23018#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23019pub struct PARAM_VALUE_DATA {
23020 #[doc = "Onboard parameter value"]
23021 pub param_value: f32,
23022 #[doc = "Total number of onboard parameters"]
23023 pub param_count: u16,
23024 #[doc = "Index of this onboard parameter"]
23025 pub param_index: u16,
23026 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23027 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23028 pub param_id: [u8; 16],
23029 #[doc = "Onboard parameter type."]
23030 pub param_type: MavParamType,
23031}
23032impl PARAM_VALUE_DATA {
23033 pub const ENCODED_LEN: usize = 25usize;
23034 pub const DEFAULT: Self = Self {
23035 param_value: 0.0_f32,
23036 param_count: 0_u16,
23037 param_index: 0_u16,
23038 param_id: [0_u8; 16usize],
23039 param_type: MavParamType::DEFAULT,
23040 };
23041 #[cfg(feature = "arbitrary")]
23042 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23043 use arbitrary::{Arbitrary, Unstructured};
23044 let mut buf = [0u8; 1024];
23045 rng.fill_bytes(&mut buf);
23046 let mut unstructured = Unstructured::new(&buf);
23047 Self::arbitrary(&mut unstructured).unwrap_or_default()
23048 }
23049}
23050impl Default for PARAM_VALUE_DATA {
23051 fn default() -> Self {
23052 Self::DEFAULT.clone()
23053 }
23054}
23055impl MessageData for PARAM_VALUE_DATA {
23056 type Message = MavMessage;
23057 const ID: u32 = 22u32;
23058 const NAME: &'static str = "PARAM_VALUE";
23059 const EXTRA_CRC: u8 = 220u8;
23060 const ENCODED_LEN: usize = 25usize;
23061 fn deser(
23062 _version: MavlinkVersion,
23063 __input: &[u8],
23064 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23065 let avail_len = __input.len();
23066 let mut payload_buf = [0; Self::ENCODED_LEN];
23067 let mut buf = if avail_len < Self::ENCODED_LEN {
23068 payload_buf[0..avail_len].copy_from_slice(__input);
23069 Bytes::new(&payload_buf)
23070 } else {
23071 Bytes::new(__input)
23072 };
23073 let mut __struct = Self::default();
23074 __struct.param_value = buf.get_f32_le();
23075 __struct.param_count = buf.get_u16_le();
23076 __struct.param_index = buf.get_u16_le();
23077 for v in &mut __struct.param_id {
23078 let val = buf.get_u8();
23079 *v = val;
23080 }
23081 let tmp = buf.get_u8();
23082 __struct.param_type =
23083 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23084 enum_type: "MavParamType",
23085 value: tmp as u32,
23086 })?;
23087 Ok(__struct)
23088 }
23089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23090 let mut __tmp = BytesMut::new(bytes);
23091 #[allow(clippy::absurd_extreme_comparisons)]
23092 #[allow(unused_comparisons)]
23093 if __tmp.remaining() < Self::ENCODED_LEN {
23094 panic!(
23095 "buffer is too small (need {} bytes, but got {})",
23096 Self::ENCODED_LEN,
23097 __tmp.remaining(),
23098 )
23099 }
23100 __tmp.put_f32_le(self.param_value);
23101 __tmp.put_u16_le(self.param_count);
23102 __tmp.put_u16_le(self.param_index);
23103 for val in &self.param_id {
23104 __tmp.put_u8(*val);
23105 }
23106 __tmp.put_u8(self.param_type as u8);
23107 if matches!(version, MavlinkVersion::V2) {
23108 let len = __tmp.len();
23109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23110 } else {
23111 __tmp.len()
23112 }
23113 }
23114}
23115#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
23116#[doc = "id: 4"]
23117#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
23118#[derive(Debug, Clone, PartialEq)]
23119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23121pub struct PING_DATA {
23122 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23123 pub time_usec: u64,
23124 #[doc = "PING sequence"]
23125 pub seq: u32,
23126 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
23127 pub target_system: u8,
23128 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
23129 pub target_component: u8,
23130}
23131impl PING_DATA {
23132 pub const ENCODED_LEN: usize = 14usize;
23133 pub const DEFAULT: Self = Self {
23134 time_usec: 0_u64,
23135 seq: 0_u32,
23136 target_system: 0_u8,
23137 target_component: 0_u8,
23138 };
23139 #[cfg(feature = "arbitrary")]
23140 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23141 use arbitrary::{Arbitrary, Unstructured};
23142 let mut buf = [0u8; 1024];
23143 rng.fill_bytes(&mut buf);
23144 let mut unstructured = Unstructured::new(&buf);
23145 Self::arbitrary(&mut unstructured).unwrap_or_default()
23146 }
23147}
23148impl Default for PING_DATA {
23149 fn default() -> Self {
23150 Self::DEFAULT.clone()
23151 }
23152}
23153impl MessageData for PING_DATA {
23154 type Message = MavMessage;
23155 const ID: u32 = 4u32;
23156 const NAME: &'static str = "PING";
23157 const EXTRA_CRC: u8 = 237u8;
23158 const ENCODED_LEN: usize = 14usize;
23159 fn deser(
23160 _version: MavlinkVersion,
23161 __input: &[u8],
23162 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23163 let avail_len = __input.len();
23164 let mut payload_buf = [0; Self::ENCODED_LEN];
23165 let mut buf = if avail_len < Self::ENCODED_LEN {
23166 payload_buf[0..avail_len].copy_from_slice(__input);
23167 Bytes::new(&payload_buf)
23168 } else {
23169 Bytes::new(__input)
23170 };
23171 let mut __struct = Self::default();
23172 __struct.time_usec = buf.get_u64_le();
23173 __struct.seq = buf.get_u32_le();
23174 __struct.target_system = buf.get_u8();
23175 __struct.target_component = buf.get_u8();
23176 Ok(__struct)
23177 }
23178 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23179 let mut __tmp = BytesMut::new(bytes);
23180 #[allow(clippy::absurd_extreme_comparisons)]
23181 #[allow(unused_comparisons)]
23182 if __tmp.remaining() < Self::ENCODED_LEN {
23183 panic!(
23184 "buffer is too small (need {} bytes, but got {})",
23185 Self::ENCODED_LEN,
23186 __tmp.remaining(),
23187 )
23188 }
23189 __tmp.put_u64_le(self.time_usec);
23190 __tmp.put_u32_le(self.seq);
23191 __tmp.put_u8(self.target_system);
23192 __tmp.put_u8(self.target_component);
23193 if matches!(version, MavlinkVersion::V2) {
23194 let len = __tmp.len();
23195 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23196 } else {
23197 __tmp.len()
23198 }
23199 }
23200}
23201#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
23202#[doc = "id: 258"]
23203#[doc = "Control vehicle tone generation (buzzer)."]
23204#[derive(Debug, Clone, PartialEq)]
23205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23207pub struct PLAY_TUNE_DATA {
23208 #[doc = "System ID"]
23209 pub target_system: u8,
23210 #[doc = "Component ID"]
23211 pub target_component: u8,
23212 #[doc = "tune in board specific format"]
23213 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23214 pub tune: [u8; 30],
23215 #[doc = "tune extension (appended to tune)"]
23216 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23217 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23218 pub tune2: [u8; 200],
23219}
23220impl PLAY_TUNE_DATA {
23221 pub const ENCODED_LEN: usize = 232usize;
23222 pub const DEFAULT: Self = Self {
23223 target_system: 0_u8,
23224 target_component: 0_u8,
23225 tune: [0_u8; 30usize],
23226 tune2: [0_u8; 200usize],
23227 };
23228 #[cfg(feature = "arbitrary")]
23229 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23230 use arbitrary::{Arbitrary, Unstructured};
23231 let mut buf = [0u8; 1024];
23232 rng.fill_bytes(&mut buf);
23233 let mut unstructured = Unstructured::new(&buf);
23234 Self::arbitrary(&mut unstructured).unwrap_or_default()
23235 }
23236}
23237impl Default for PLAY_TUNE_DATA {
23238 fn default() -> Self {
23239 Self::DEFAULT.clone()
23240 }
23241}
23242impl MessageData for PLAY_TUNE_DATA {
23243 type Message = MavMessage;
23244 const ID: u32 = 258u32;
23245 const NAME: &'static str = "PLAY_TUNE";
23246 const EXTRA_CRC: u8 = 187u8;
23247 const ENCODED_LEN: usize = 232usize;
23248 fn deser(
23249 _version: MavlinkVersion,
23250 __input: &[u8],
23251 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23252 let avail_len = __input.len();
23253 let mut payload_buf = [0; Self::ENCODED_LEN];
23254 let mut buf = if avail_len < Self::ENCODED_LEN {
23255 payload_buf[0..avail_len].copy_from_slice(__input);
23256 Bytes::new(&payload_buf)
23257 } else {
23258 Bytes::new(__input)
23259 };
23260 let mut __struct = Self::default();
23261 __struct.target_system = buf.get_u8();
23262 __struct.target_component = buf.get_u8();
23263 for v in &mut __struct.tune {
23264 let val = buf.get_u8();
23265 *v = val;
23266 }
23267 for v in &mut __struct.tune2 {
23268 let val = buf.get_u8();
23269 *v = val;
23270 }
23271 Ok(__struct)
23272 }
23273 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23274 let mut __tmp = BytesMut::new(bytes);
23275 #[allow(clippy::absurd_extreme_comparisons)]
23276 #[allow(unused_comparisons)]
23277 if __tmp.remaining() < Self::ENCODED_LEN {
23278 panic!(
23279 "buffer is too small (need {} bytes, but got {})",
23280 Self::ENCODED_LEN,
23281 __tmp.remaining(),
23282 )
23283 }
23284 __tmp.put_u8(self.target_system);
23285 __tmp.put_u8(self.target_component);
23286 for val in &self.tune {
23287 __tmp.put_u8(*val);
23288 }
23289 for val in &self.tune2 {
23290 __tmp.put_u8(*val);
23291 }
23292 if matches!(version, MavlinkVersion::V2) {
23293 let len = __tmp.len();
23294 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23295 } else {
23296 __tmp.len()
23297 }
23298 }
23299}
23300#[doc = "id: 400"]
23301#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
23302#[derive(Debug, Clone, PartialEq)]
23303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23305pub struct PLAY_TUNE_V2_DATA {
23306 #[doc = "Tune format"]
23307 pub format: TuneFormat,
23308 #[doc = "System ID"]
23309 pub target_system: u8,
23310 #[doc = "Component ID"]
23311 pub target_component: u8,
23312 #[doc = "Tune definition as a NULL-terminated string."]
23313 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23314 pub tune: [u8; 248],
23315}
23316impl PLAY_TUNE_V2_DATA {
23317 pub const ENCODED_LEN: usize = 254usize;
23318 pub const DEFAULT: Self = Self {
23319 format: TuneFormat::DEFAULT,
23320 target_system: 0_u8,
23321 target_component: 0_u8,
23322 tune: [0_u8; 248usize],
23323 };
23324 #[cfg(feature = "arbitrary")]
23325 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23326 use arbitrary::{Arbitrary, Unstructured};
23327 let mut buf = [0u8; 1024];
23328 rng.fill_bytes(&mut buf);
23329 let mut unstructured = Unstructured::new(&buf);
23330 Self::arbitrary(&mut unstructured).unwrap_or_default()
23331 }
23332}
23333impl Default for PLAY_TUNE_V2_DATA {
23334 fn default() -> Self {
23335 Self::DEFAULT.clone()
23336 }
23337}
23338impl MessageData for PLAY_TUNE_V2_DATA {
23339 type Message = MavMessage;
23340 const ID: u32 = 400u32;
23341 const NAME: &'static str = "PLAY_TUNE_V2";
23342 const EXTRA_CRC: u8 = 110u8;
23343 const ENCODED_LEN: usize = 254usize;
23344 fn deser(
23345 _version: MavlinkVersion,
23346 __input: &[u8],
23347 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23348 let avail_len = __input.len();
23349 let mut payload_buf = [0; Self::ENCODED_LEN];
23350 let mut buf = if avail_len < Self::ENCODED_LEN {
23351 payload_buf[0..avail_len].copy_from_slice(__input);
23352 Bytes::new(&payload_buf)
23353 } else {
23354 Bytes::new(__input)
23355 };
23356 let mut __struct = Self::default();
23357 let tmp = buf.get_u32_le();
23358 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
23359 ::mavlink_core::error::ParserError::InvalidEnum {
23360 enum_type: "TuneFormat",
23361 value: tmp as u32,
23362 },
23363 )?;
23364 __struct.target_system = buf.get_u8();
23365 __struct.target_component = buf.get_u8();
23366 for v in &mut __struct.tune {
23367 let val = buf.get_u8();
23368 *v = val;
23369 }
23370 Ok(__struct)
23371 }
23372 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23373 let mut __tmp = BytesMut::new(bytes);
23374 #[allow(clippy::absurd_extreme_comparisons)]
23375 #[allow(unused_comparisons)]
23376 if __tmp.remaining() < Self::ENCODED_LEN {
23377 panic!(
23378 "buffer is too small (need {} bytes, but got {})",
23379 Self::ENCODED_LEN,
23380 __tmp.remaining(),
23381 )
23382 }
23383 __tmp.put_u32_le(self.format as u32);
23384 __tmp.put_u8(self.target_system);
23385 __tmp.put_u8(self.target_component);
23386 for val in &self.tune {
23387 __tmp.put_u8(*val);
23388 }
23389 if matches!(version, MavlinkVersion::V2) {
23390 let len = __tmp.len();
23391 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23392 } else {
23393 __tmp.len()
23394 }
23395 }
23396}
23397#[doc = "id: 87"]
23398#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
23399#[derive(Debug, Clone, PartialEq)]
23400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23401#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23402pub struct POSITION_TARGET_GLOBAL_INT_DATA {
23403 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
23404 pub time_boot_ms: u32,
23405 #[doc = "Latitude in WGS84 frame"]
23406 pub lat_int: i32,
23407 #[doc = "Longitude in WGS84 frame"]
23408 pub lon_int: i32,
23409 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
23410 pub alt: f32,
23411 #[doc = "X velocity in NED frame"]
23412 pub vx: f32,
23413 #[doc = "Y velocity in NED frame"]
23414 pub vy: f32,
23415 #[doc = "Z velocity in NED frame"]
23416 pub vz: f32,
23417 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23418 pub afx: f32,
23419 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23420 pub afy: f32,
23421 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23422 pub afz: f32,
23423 #[doc = "yaw setpoint"]
23424 pub yaw: f32,
23425 #[doc = "yaw rate setpoint"]
23426 pub yaw_rate: f32,
23427 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23428 pub type_mask: PositionTargetTypemask,
23429 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
23430 pub coordinate_frame: MavFrame,
23431}
23432impl POSITION_TARGET_GLOBAL_INT_DATA {
23433 pub const ENCODED_LEN: usize = 51usize;
23434 pub const DEFAULT: Self = Self {
23435 time_boot_ms: 0_u32,
23436 lat_int: 0_i32,
23437 lon_int: 0_i32,
23438 alt: 0.0_f32,
23439 vx: 0.0_f32,
23440 vy: 0.0_f32,
23441 vz: 0.0_f32,
23442 afx: 0.0_f32,
23443 afy: 0.0_f32,
23444 afz: 0.0_f32,
23445 yaw: 0.0_f32,
23446 yaw_rate: 0.0_f32,
23447 type_mask: PositionTargetTypemask::DEFAULT,
23448 coordinate_frame: MavFrame::DEFAULT,
23449 };
23450 #[cfg(feature = "arbitrary")]
23451 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23452 use arbitrary::{Arbitrary, Unstructured};
23453 let mut buf = [0u8; 1024];
23454 rng.fill_bytes(&mut buf);
23455 let mut unstructured = Unstructured::new(&buf);
23456 Self::arbitrary(&mut unstructured).unwrap_or_default()
23457 }
23458}
23459impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
23460 fn default() -> Self {
23461 Self::DEFAULT.clone()
23462 }
23463}
23464impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
23465 type Message = MavMessage;
23466 const ID: u32 = 87u32;
23467 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
23468 const EXTRA_CRC: u8 = 150u8;
23469 const ENCODED_LEN: usize = 51usize;
23470 fn deser(
23471 _version: MavlinkVersion,
23472 __input: &[u8],
23473 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23474 let avail_len = __input.len();
23475 let mut payload_buf = [0; Self::ENCODED_LEN];
23476 let mut buf = if avail_len < Self::ENCODED_LEN {
23477 payload_buf[0..avail_len].copy_from_slice(__input);
23478 Bytes::new(&payload_buf)
23479 } else {
23480 Bytes::new(__input)
23481 };
23482 let mut __struct = Self::default();
23483 __struct.time_boot_ms = buf.get_u32_le();
23484 __struct.lat_int = buf.get_i32_le();
23485 __struct.lon_int = buf.get_i32_le();
23486 __struct.alt = buf.get_f32_le();
23487 __struct.vx = buf.get_f32_le();
23488 __struct.vy = buf.get_f32_le();
23489 __struct.vz = buf.get_f32_le();
23490 __struct.afx = buf.get_f32_le();
23491 __struct.afy = buf.get_f32_le();
23492 __struct.afz = buf.get_f32_le();
23493 __struct.yaw = buf.get_f32_le();
23494 __struct.yaw_rate = buf.get_f32_le();
23495 let tmp = buf.get_u16_le();
23496 __struct.type_mask = PositionTargetTypemask::from_bits(
23497 tmp & PositionTargetTypemask::all().bits(),
23498 )
23499 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23500 flag_type: "PositionTargetTypemask",
23501 value: tmp as u32,
23502 })?;
23503 let tmp = buf.get_u8();
23504 __struct.coordinate_frame =
23505 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23506 enum_type: "MavFrame",
23507 value: tmp as u32,
23508 })?;
23509 Ok(__struct)
23510 }
23511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23512 let mut __tmp = BytesMut::new(bytes);
23513 #[allow(clippy::absurd_extreme_comparisons)]
23514 #[allow(unused_comparisons)]
23515 if __tmp.remaining() < Self::ENCODED_LEN {
23516 panic!(
23517 "buffer is too small (need {} bytes, but got {})",
23518 Self::ENCODED_LEN,
23519 __tmp.remaining(),
23520 )
23521 }
23522 __tmp.put_u32_le(self.time_boot_ms);
23523 __tmp.put_i32_le(self.lat_int);
23524 __tmp.put_i32_le(self.lon_int);
23525 __tmp.put_f32_le(self.alt);
23526 __tmp.put_f32_le(self.vx);
23527 __tmp.put_f32_le(self.vy);
23528 __tmp.put_f32_le(self.vz);
23529 __tmp.put_f32_le(self.afx);
23530 __tmp.put_f32_le(self.afy);
23531 __tmp.put_f32_le(self.afz);
23532 __tmp.put_f32_le(self.yaw);
23533 __tmp.put_f32_le(self.yaw_rate);
23534 __tmp.put_u16_le(self.type_mask.bits());
23535 __tmp.put_u8(self.coordinate_frame as u8);
23536 if matches!(version, MavlinkVersion::V2) {
23537 let len = __tmp.len();
23538 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23539 } else {
23540 __tmp.len()
23541 }
23542 }
23543}
23544#[doc = "id: 85"]
23545#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
23546#[derive(Debug, Clone, PartialEq)]
23547#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23549pub struct POSITION_TARGET_LOCAL_NED_DATA {
23550 #[doc = "Timestamp (time since system boot)."]
23551 pub time_boot_ms: u32,
23552 #[doc = "X Position in NED frame"]
23553 pub x: f32,
23554 #[doc = "Y Position in NED frame"]
23555 pub y: f32,
23556 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
23557 pub z: f32,
23558 #[doc = "X velocity in NED frame"]
23559 pub vx: f32,
23560 #[doc = "Y velocity in NED frame"]
23561 pub vy: f32,
23562 #[doc = "Z velocity in NED frame"]
23563 pub vz: f32,
23564 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23565 pub afx: f32,
23566 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23567 pub afy: f32,
23568 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23569 pub afz: f32,
23570 #[doc = "yaw setpoint"]
23571 pub yaw: f32,
23572 #[doc = "yaw rate setpoint"]
23573 pub yaw_rate: f32,
23574 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23575 pub type_mask: PositionTargetTypemask,
23576 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
23577 pub coordinate_frame: MavFrame,
23578}
23579impl POSITION_TARGET_LOCAL_NED_DATA {
23580 pub const ENCODED_LEN: usize = 51usize;
23581 pub const DEFAULT: Self = Self {
23582 time_boot_ms: 0_u32,
23583 x: 0.0_f32,
23584 y: 0.0_f32,
23585 z: 0.0_f32,
23586 vx: 0.0_f32,
23587 vy: 0.0_f32,
23588 vz: 0.0_f32,
23589 afx: 0.0_f32,
23590 afy: 0.0_f32,
23591 afz: 0.0_f32,
23592 yaw: 0.0_f32,
23593 yaw_rate: 0.0_f32,
23594 type_mask: PositionTargetTypemask::DEFAULT,
23595 coordinate_frame: MavFrame::DEFAULT,
23596 };
23597 #[cfg(feature = "arbitrary")]
23598 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23599 use arbitrary::{Arbitrary, Unstructured};
23600 let mut buf = [0u8; 1024];
23601 rng.fill_bytes(&mut buf);
23602 let mut unstructured = Unstructured::new(&buf);
23603 Self::arbitrary(&mut unstructured).unwrap_or_default()
23604 }
23605}
23606impl Default for POSITION_TARGET_LOCAL_NED_DATA {
23607 fn default() -> Self {
23608 Self::DEFAULT.clone()
23609 }
23610}
23611impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
23612 type Message = MavMessage;
23613 const ID: u32 = 85u32;
23614 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
23615 const EXTRA_CRC: u8 = 140u8;
23616 const ENCODED_LEN: usize = 51usize;
23617 fn deser(
23618 _version: MavlinkVersion,
23619 __input: &[u8],
23620 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23621 let avail_len = __input.len();
23622 let mut payload_buf = [0; Self::ENCODED_LEN];
23623 let mut buf = if avail_len < Self::ENCODED_LEN {
23624 payload_buf[0..avail_len].copy_from_slice(__input);
23625 Bytes::new(&payload_buf)
23626 } else {
23627 Bytes::new(__input)
23628 };
23629 let mut __struct = Self::default();
23630 __struct.time_boot_ms = buf.get_u32_le();
23631 __struct.x = buf.get_f32_le();
23632 __struct.y = buf.get_f32_le();
23633 __struct.z = buf.get_f32_le();
23634 __struct.vx = buf.get_f32_le();
23635 __struct.vy = buf.get_f32_le();
23636 __struct.vz = buf.get_f32_le();
23637 __struct.afx = buf.get_f32_le();
23638 __struct.afy = buf.get_f32_le();
23639 __struct.afz = buf.get_f32_le();
23640 __struct.yaw = buf.get_f32_le();
23641 __struct.yaw_rate = buf.get_f32_le();
23642 let tmp = buf.get_u16_le();
23643 __struct.type_mask = PositionTargetTypemask::from_bits(
23644 tmp & PositionTargetTypemask::all().bits(),
23645 )
23646 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23647 flag_type: "PositionTargetTypemask",
23648 value: tmp as u32,
23649 })?;
23650 let tmp = buf.get_u8();
23651 __struct.coordinate_frame =
23652 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23653 enum_type: "MavFrame",
23654 value: tmp as u32,
23655 })?;
23656 Ok(__struct)
23657 }
23658 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23659 let mut __tmp = BytesMut::new(bytes);
23660 #[allow(clippy::absurd_extreme_comparisons)]
23661 #[allow(unused_comparisons)]
23662 if __tmp.remaining() < Self::ENCODED_LEN {
23663 panic!(
23664 "buffer is too small (need {} bytes, but got {})",
23665 Self::ENCODED_LEN,
23666 __tmp.remaining(),
23667 )
23668 }
23669 __tmp.put_u32_le(self.time_boot_ms);
23670 __tmp.put_f32_le(self.x);
23671 __tmp.put_f32_le(self.y);
23672 __tmp.put_f32_le(self.z);
23673 __tmp.put_f32_le(self.vx);
23674 __tmp.put_f32_le(self.vy);
23675 __tmp.put_f32_le(self.vz);
23676 __tmp.put_f32_le(self.afx);
23677 __tmp.put_f32_le(self.afy);
23678 __tmp.put_f32_le(self.afz);
23679 __tmp.put_f32_le(self.yaw);
23680 __tmp.put_f32_le(self.yaw_rate);
23681 __tmp.put_u16_le(self.type_mask.bits());
23682 __tmp.put_u8(self.coordinate_frame as u8);
23683 if matches!(version, MavlinkVersion::V2) {
23684 let len = __tmp.len();
23685 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23686 } else {
23687 __tmp.len()
23688 }
23689 }
23690}
23691#[doc = "id: 125"]
23692#[doc = "Power supply status."]
23693#[derive(Debug, Clone, PartialEq)]
23694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23695#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23696pub struct POWER_STATUS_DATA {
23697 #[doc = "5V rail voltage."]
23698 pub Vcc: u16,
23699 #[doc = "Servo rail voltage."]
23700 pub Vservo: u16,
23701 #[doc = "Bitmap of power supply status flags."]
23702 pub flags: MavPowerStatus,
23703}
23704impl POWER_STATUS_DATA {
23705 pub const ENCODED_LEN: usize = 6usize;
23706 pub const DEFAULT: Self = Self {
23707 Vcc: 0_u16,
23708 Vservo: 0_u16,
23709 flags: MavPowerStatus::DEFAULT,
23710 };
23711 #[cfg(feature = "arbitrary")]
23712 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23713 use arbitrary::{Arbitrary, Unstructured};
23714 let mut buf = [0u8; 1024];
23715 rng.fill_bytes(&mut buf);
23716 let mut unstructured = Unstructured::new(&buf);
23717 Self::arbitrary(&mut unstructured).unwrap_or_default()
23718 }
23719}
23720impl Default for POWER_STATUS_DATA {
23721 fn default() -> Self {
23722 Self::DEFAULT.clone()
23723 }
23724}
23725impl MessageData for POWER_STATUS_DATA {
23726 type Message = MavMessage;
23727 const ID: u32 = 125u32;
23728 const NAME: &'static str = "POWER_STATUS";
23729 const EXTRA_CRC: u8 = 203u8;
23730 const ENCODED_LEN: usize = 6usize;
23731 fn deser(
23732 _version: MavlinkVersion,
23733 __input: &[u8],
23734 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23735 let avail_len = __input.len();
23736 let mut payload_buf = [0; Self::ENCODED_LEN];
23737 let mut buf = if avail_len < Self::ENCODED_LEN {
23738 payload_buf[0..avail_len].copy_from_slice(__input);
23739 Bytes::new(&payload_buf)
23740 } else {
23741 Bytes::new(__input)
23742 };
23743 let mut __struct = Self::default();
23744 __struct.Vcc = buf.get_u16_le();
23745 __struct.Vservo = buf.get_u16_le();
23746 let tmp = buf.get_u16_le();
23747 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
23748 ::mavlink_core::error::ParserError::InvalidFlag {
23749 flag_type: "MavPowerStatus",
23750 value: tmp as u32,
23751 },
23752 )?;
23753 Ok(__struct)
23754 }
23755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23756 let mut __tmp = BytesMut::new(bytes);
23757 #[allow(clippy::absurd_extreme_comparisons)]
23758 #[allow(unused_comparisons)]
23759 if __tmp.remaining() < Self::ENCODED_LEN {
23760 panic!(
23761 "buffer is too small (need {} bytes, but got {})",
23762 Self::ENCODED_LEN,
23763 __tmp.remaining(),
23764 )
23765 }
23766 __tmp.put_u16_le(self.Vcc);
23767 __tmp.put_u16_le(self.Vservo);
23768 __tmp.put_u16_le(self.flags.bits());
23769 if matches!(version, MavlinkVersion::V2) {
23770 let len = __tmp.len();
23771 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23772 } else {
23773 __tmp.len()
23774 }
23775 }
23776}
23777#[doc = "id: 300"]
23778#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
23779#[derive(Debug, Clone, PartialEq)]
23780#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23782pub struct PROTOCOL_VERSION_DATA {
23783 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
23784 pub version: u16,
23785 #[doc = "Minimum MAVLink version supported"]
23786 pub min_version: u16,
23787 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
23788 pub max_version: u16,
23789 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
23790 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23791 pub spec_version_hash: [u8; 8],
23792 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
23793 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23794 pub library_version_hash: [u8; 8],
23795}
23796impl PROTOCOL_VERSION_DATA {
23797 pub const ENCODED_LEN: usize = 22usize;
23798 pub const DEFAULT: Self = Self {
23799 version: 0_u16,
23800 min_version: 0_u16,
23801 max_version: 0_u16,
23802 spec_version_hash: [0_u8; 8usize],
23803 library_version_hash: [0_u8; 8usize],
23804 };
23805 #[cfg(feature = "arbitrary")]
23806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23807 use arbitrary::{Arbitrary, Unstructured};
23808 let mut buf = [0u8; 1024];
23809 rng.fill_bytes(&mut buf);
23810 let mut unstructured = Unstructured::new(&buf);
23811 Self::arbitrary(&mut unstructured).unwrap_or_default()
23812 }
23813}
23814impl Default for PROTOCOL_VERSION_DATA {
23815 fn default() -> Self {
23816 Self::DEFAULT.clone()
23817 }
23818}
23819impl MessageData for PROTOCOL_VERSION_DATA {
23820 type Message = MavMessage;
23821 const ID: u32 = 300u32;
23822 const NAME: &'static str = "PROTOCOL_VERSION";
23823 const EXTRA_CRC: u8 = 217u8;
23824 const ENCODED_LEN: usize = 22usize;
23825 fn deser(
23826 _version: MavlinkVersion,
23827 __input: &[u8],
23828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23829 let avail_len = __input.len();
23830 let mut payload_buf = [0; Self::ENCODED_LEN];
23831 let mut buf = if avail_len < Self::ENCODED_LEN {
23832 payload_buf[0..avail_len].copy_from_slice(__input);
23833 Bytes::new(&payload_buf)
23834 } else {
23835 Bytes::new(__input)
23836 };
23837 let mut __struct = Self::default();
23838 __struct.version = buf.get_u16_le();
23839 __struct.min_version = buf.get_u16_le();
23840 __struct.max_version = buf.get_u16_le();
23841 for v in &mut __struct.spec_version_hash {
23842 let val = buf.get_u8();
23843 *v = val;
23844 }
23845 for v in &mut __struct.library_version_hash {
23846 let val = buf.get_u8();
23847 *v = val;
23848 }
23849 Ok(__struct)
23850 }
23851 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23852 let mut __tmp = BytesMut::new(bytes);
23853 #[allow(clippy::absurd_extreme_comparisons)]
23854 #[allow(unused_comparisons)]
23855 if __tmp.remaining() < Self::ENCODED_LEN {
23856 panic!(
23857 "buffer is too small (need {} bytes, but got {})",
23858 Self::ENCODED_LEN,
23859 __tmp.remaining(),
23860 )
23861 }
23862 __tmp.put_u16_le(self.version);
23863 __tmp.put_u16_le(self.min_version);
23864 __tmp.put_u16_le(self.max_version);
23865 for val in &self.spec_version_hash {
23866 __tmp.put_u8(*val);
23867 }
23868 for val in &self.library_version_hash {
23869 __tmp.put_u8(*val);
23870 }
23871 if matches!(version, MavlinkVersion::V2) {
23872 let len = __tmp.len();
23873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23874 } else {
23875 __tmp.len()
23876 }
23877 }
23878}
23879#[doc = "id: 109"]
23880#[doc = "Status generated by radio and injected into MAVLink stream."]
23881#[derive(Debug, Clone, PartialEq)]
23882#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23883#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23884pub struct RADIO_STATUS_DATA {
23885 #[doc = "Count of radio packet receive errors (since boot)."]
23886 pub rxerrors: u16,
23887 #[doc = "Count of error corrected radio packets (since boot)."]
23888 pub fixed: u16,
23889 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
23890 pub rssi: u8,
23891 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
23892 pub remrssi: u8,
23893 #[doc = "Remaining free transmitter buffer space."]
23894 pub txbuf: u8,
23895 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
23896 pub noise: u8,
23897 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
23898 pub remnoise: u8,
23899}
23900impl RADIO_STATUS_DATA {
23901 pub const ENCODED_LEN: usize = 9usize;
23902 pub const DEFAULT: Self = Self {
23903 rxerrors: 0_u16,
23904 fixed: 0_u16,
23905 rssi: 0_u8,
23906 remrssi: 0_u8,
23907 txbuf: 0_u8,
23908 noise: 0_u8,
23909 remnoise: 0_u8,
23910 };
23911 #[cfg(feature = "arbitrary")]
23912 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23913 use arbitrary::{Arbitrary, Unstructured};
23914 let mut buf = [0u8; 1024];
23915 rng.fill_bytes(&mut buf);
23916 let mut unstructured = Unstructured::new(&buf);
23917 Self::arbitrary(&mut unstructured).unwrap_or_default()
23918 }
23919}
23920impl Default for RADIO_STATUS_DATA {
23921 fn default() -> Self {
23922 Self::DEFAULT.clone()
23923 }
23924}
23925impl MessageData for RADIO_STATUS_DATA {
23926 type Message = MavMessage;
23927 const ID: u32 = 109u32;
23928 const NAME: &'static str = "RADIO_STATUS";
23929 const EXTRA_CRC: u8 = 185u8;
23930 const ENCODED_LEN: usize = 9usize;
23931 fn deser(
23932 _version: MavlinkVersion,
23933 __input: &[u8],
23934 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23935 let avail_len = __input.len();
23936 let mut payload_buf = [0; Self::ENCODED_LEN];
23937 let mut buf = if avail_len < Self::ENCODED_LEN {
23938 payload_buf[0..avail_len].copy_from_slice(__input);
23939 Bytes::new(&payload_buf)
23940 } else {
23941 Bytes::new(__input)
23942 };
23943 let mut __struct = Self::default();
23944 __struct.rxerrors = buf.get_u16_le();
23945 __struct.fixed = buf.get_u16_le();
23946 __struct.rssi = buf.get_u8();
23947 __struct.remrssi = buf.get_u8();
23948 __struct.txbuf = buf.get_u8();
23949 __struct.noise = buf.get_u8();
23950 __struct.remnoise = buf.get_u8();
23951 Ok(__struct)
23952 }
23953 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23954 let mut __tmp = BytesMut::new(bytes);
23955 #[allow(clippy::absurd_extreme_comparisons)]
23956 #[allow(unused_comparisons)]
23957 if __tmp.remaining() < Self::ENCODED_LEN {
23958 panic!(
23959 "buffer is too small (need {} bytes, but got {})",
23960 Self::ENCODED_LEN,
23961 __tmp.remaining(),
23962 )
23963 }
23964 __tmp.put_u16_le(self.rxerrors);
23965 __tmp.put_u16_le(self.fixed);
23966 __tmp.put_u8(self.rssi);
23967 __tmp.put_u8(self.remrssi);
23968 __tmp.put_u8(self.txbuf);
23969 __tmp.put_u8(self.noise);
23970 __tmp.put_u8(self.remnoise);
23971 if matches!(version, MavlinkVersion::V2) {
23972 let len = __tmp.len();
23973 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23974 } else {
23975 __tmp.len()
23976 }
23977 }
23978}
23979#[doc = "id: 27"]
23980#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
23981#[derive(Debug, Clone, PartialEq)]
23982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23984pub struct RAW_IMU_DATA {
23985 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23986 pub time_usec: u64,
23987 #[doc = "X acceleration (raw)"]
23988 pub xacc: i16,
23989 #[doc = "Y acceleration (raw)"]
23990 pub yacc: i16,
23991 #[doc = "Z acceleration (raw)"]
23992 pub zacc: i16,
23993 #[doc = "Angular speed around X axis (raw)"]
23994 pub xgyro: i16,
23995 #[doc = "Angular speed around Y axis (raw)"]
23996 pub ygyro: i16,
23997 #[doc = "Angular speed around Z axis (raw)"]
23998 pub zgyro: i16,
23999 #[doc = "X Magnetic field (raw)"]
24000 pub xmag: i16,
24001 #[doc = "Y Magnetic field (raw)"]
24002 pub ymag: i16,
24003 #[doc = "Z Magnetic field (raw)"]
24004 pub zmag: i16,
24005 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24006 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24007 pub id: u8,
24008 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
24009 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24010 pub temperature: i16,
24011}
24012impl RAW_IMU_DATA {
24013 pub const ENCODED_LEN: usize = 29usize;
24014 pub const DEFAULT: Self = Self {
24015 time_usec: 0_u64,
24016 xacc: 0_i16,
24017 yacc: 0_i16,
24018 zacc: 0_i16,
24019 xgyro: 0_i16,
24020 ygyro: 0_i16,
24021 zgyro: 0_i16,
24022 xmag: 0_i16,
24023 ymag: 0_i16,
24024 zmag: 0_i16,
24025 id: 0_u8,
24026 temperature: 0_i16,
24027 };
24028 #[cfg(feature = "arbitrary")]
24029 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24030 use arbitrary::{Arbitrary, Unstructured};
24031 let mut buf = [0u8; 1024];
24032 rng.fill_bytes(&mut buf);
24033 let mut unstructured = Unstructured::new(&buf);
24034 Self::arbitrary(&mut unstructured).unwrap_or_default()
24035 }
24036}
24037impl Default for RAW_IMU_DATA {
24038 fn default() -> Self {
24039 Self::DEFAULT.clone()
24040 }
24041}
24042impl MessageData for RAW_IMU_DATA {
24043 type Message = MavMessage;
24044 const ID: u32 = 27u32;
24045 const NAME: &'static str = "RAW_IMU";
24046 const EXTRA_CRC: u8 = 144u8;
24047 const ENCODED_LEN: usize = 29usize;
24048 fn deser(
24049 _version: MavlinkVersion,
24050 __input: &[u8],
24051 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24052 let avail_len = __input.len();
24053 let mut payload_buf = [0; Self::ENCODED_LEN];
24054 let mut buf = if avail_len < Self::ENCODED_LEN {
24055 payload_buf[0..avail_len].copy_from_slice(__input);
24056 Bytes::new(&payload_buf)
24057 } else {
24058 Bytes::new(__input)
24059 };
24060 let mut __struct = Self::default();
24061 __struct.time_usec = buf.get_u64_le();
24062 __struct.xacc = buf.get_i16_le();
24063 __struct.yacc = buf.get_i16_le();
24064 __struct.zacc = buf.get_i16_le();
24065 __struct.xgyro = buf.get_i16_le();
24066 __struct.ygyro = buf.get_i16_le();
24067 __struct.zgyro = buf.get_i16_le();
24068 __struct.xmag = buf.get_i16_le();
24069 __struct.ymag = buf.get_i16_le();
24070 __struct.zmag = buf.get_i16_le();
24071 __struct.id = buf.get_u8();
24072 __struct.temperature = buf.get_i16_le();
24073 Ok(__struct)
24074 }
24075 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24076 let mut __tmp = BytesMut::new(bytes);
24077 #[allow(clippy::absurd_extreme_comparisons)]
24078 #[allow(unused_comparisons)]
24079 if __tmp.remaining() < Self::ENCODED_LEN {
24080 panic!(
24081 "buffer is too small (need {} bytes, but got {})",
24082 Self::ENCODED_LEN,
24083 __tmp.remaining(),
24084 )
24085 }
24086 __tmp.put_u64_le(self.time_usec);
24087 __tmp.put_i16_le(self.xacc);
24088 __tmp.put_i16_le(self.yacc);
24089 __tmp.put_i16_le(self.zacc);
24090 __tmp.put_i16_le(self.xgyro);
24091 __tmp.put_i16_le(self.ygyro);
24092 __tmp.put_i16_le(self.zgyro);
24093 __tmp.put_i16_le(self.xmag);
24094 __tmp.put_i16_le(self.ymag);
24095 __tmp.put_i16_le(self.zmag);
24096 __tmp.put_u8(self.id);
24097 __tmp.put_i16_le(self.temperature);
24098 if matches!(version, MavlinkVersion::V2) {
24099 let len = __tmp.len();
24100 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24101 } else {
24102 __tmp.len()
24103 }
24104 }
24105}
24106#[doc = "id: 28"]
24107#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
24108#[derive(Debug, Clone, PartialEq)]
24109#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24111pub struct RAW_PRESSURE_DATA {
24112 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24113 pub time_usec: u64,
24114 #[doc = "Absolute pressure (raw)"]
24115 pub press_abs: i16,
24116 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
24117 pub press_diff1: i16,
24118 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
24119 pub press_diff2: i16,
24120 #[doc = "Raw Temperature measurement (raw)"]
24121 pub temperature: i16,
24122}
24123impl RAW_PRESSURE_DATA {
24124 pub const ENCODED_LEN: usize = 16usize;
24125 pub const DEFAULT: Self = Self {
24126 time_usec: 0_u64,
24127 press_abs: 0_i16,
24128 press_diff1: 0_i16,
24129 press_diff2: 0_i16,
24130 temperature: 0_i16,
24131 };
24132 #[cfg(feature = "arbitrary")]
24133 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24134 use arbitrary::{Arbitrary, Unstructured};
24135 let mut buf = [0u8; 1024];
24136 rng.fill_bytes(&mut buf);
24137 let mut unstructured = Unstructured::new(&buf);
24138 Self::arbitrary(&mut unstructured).unwrap_or_default()
24139 }
24140}
24141impl Default for RAW_PRESSURE_DATA {
24142 fn default() -> Self {
24143 Self::DEFAULT.clone()
24144 }
24145}
24146impl MessageData for RAW_PRESSURE_DATA {
24147 type Message = MavMessage;
24148 const ID: u32 = 28u32;
24149 const NAME: &'static str = "RAW_PRESSURE";
24150 const EXTRA_CRC: u8 = 67u8;
24151 const ENCODED_LEN: usize = 16usize;
24152 fn deser(
24153 _version: MavlinkVersion,
24154 __input: &[u8],
24155 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24156 let avail_len = __input.len();
24157 let mut payload_buf = [0; Self::ENCODED_LEN];
24158 let mut buf = if avail_len < Self::ENCODED_LEN {
24159 payload_buf[0..avail_len].copy_from_slice(__input);
24160 Bytes::new(&payload_buf)
24161 } else {
24162 Bytes::new(__input)
24163 };
24164 let mut __struct = Self::default();
24165 __struct.time_usec = buf.get_u64_le();
24166 __struct.press_abs = buf.get_i16_le();
24167 __struct.press_diff1 = buf.get_i16_le();
24168 __struct.press_diff2 = buf.get_i16_le();
24169 __struct.temperature = buf.get_i16_le();
24170 Ok(__struct)
24171 }
24172 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24173 let mut __tmp = BytesMut::new(bytes);
24174 #[allow(clippy::absurd_extreme_comparisons)]
24175 #[allow(unused_comparisons)]
24176 if __tmp.remaining() < Self::ENCODED_LEN {
24177 panic!(
24178 "buffer is too small (need {} bytes, but got {})",
24179 Self::ENCODED_LEN,
24180 __tmp.remaining(),
24181 )
24182 }
24183 __tmp.put_u64_le(self.time_usec);
24184 __tmp.put_i16_le(self.press_abs);
24185 __tmp.put_i16_le(self.press_diff1);
24186 __tmp.put_i16_le(self.press_diff2);
24187 __tmp.put_i16_le(self.temperature);
24188 if matches!(version, MavlinkVersion::V2) {
24189 let len = __tmp.len();
24190 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24191 } else {
24192 __tmp.len()
24193 }
24194 }
24195}
24196#[doc = "id: 339"]
24197#[doc = "RPM sensor data message."]
24198#[derive(Debug, Clone, PartialEq)]
24199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24201pub struct RAW_RPM_DATA {
24202 #[doc = "Indicated rate"]
24203 pub frequency: f32,
24204 #[doc = "Index of this RPM sensor (0-indexed)"]
24205 pub index: u8,
24206}
24207impl RAW_RPM_DATA {
24208 pub const ENCODED_LEN: usize = 5usize;
24209 pub const DEFAULT: Self = Self {
24210 frequency: 0.0_f32,
24211 index: 0_u8,
24212 };
24213 #[cfg(feature = "arbitrary")]
24214 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24215 use arbitrary::{Arbitrary, Unstructured};
24216 let mut buf = [0u8; 1024];
24217 rng.fill_bytes(&mut buf);
24218 let mut unstructured = Unstructured::new(&buf);
24219 Self::arbitrary(&mut unstructured).unwrap_or_default()
24220 }
24221}
24222impl Default for RAW_RPM_DATA {
24223 fn default() -> Self {
24224 Self::DEFAULT.clone()
24225 }
24226}
24227impl MessageData for RAW_RPM_DATA {
24228 type Message = MavMessage;
24229 const ID: u32 = 339u32;
24230 const NAME: &'static str = "RAW_RPM";
24231 const EXTRA_CRC: u8 = 199u8;
24232 const ENCODED_LEN: usize = 5usize;
24233 fn deser(
24234 _version: MavlinkVersion,
24235 __input: &[u8],
24236 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24237 let avail_len = __input.len();
24238 let mut payload_buf = [0; Self::ENCODED_LEN];
24239 let mut buf = if avail_len < Self::ENCODED_LEN {
24240 payload_buf[0..avail_len].copy_from_slice(__input);
24241 Bytes::new(&payload_buf)
24242 } else {
24243 Bytes::new(__input)
24244 };
24245 let mut __struct = Self::default();
24246 __struct.frequency = buf.get_f32_le();
24247 __struct.index = buf.get_u8();
24248 Ok(__struct)
24249 }
24250 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24251 let mut __tmp = BytesMut::new(bytes);
24252 #[allow(clippy::absurd_extreme_comparisons)]
24253 #[allow(unused_comparisons)]
24254 if __tmp.remaining() < Self::ENCODED_LEN {
24255 panic!(
24256 "buffer is too small (need {} bytes, but got {})",
24257 Self::ENCODED_LEN,
24258 __tmp.remaining(),
24259 )
24260 }
24261 __tmp.put_f32_le(self.frequency);
24262 __tmp.put_u8(self.index);
24263 if matches!(version, MavlinkVersion::V2) {
24264 let len = __tmp.len();
24265 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24266 } else {
24267 __tmp.len()
24268 }
24269 }
24270}
24271#[doc = "id: 65"]
24272#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24273#[derive(Debug, Clone, PartialEq)]
24274#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24275#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24276pub struct RC_CHANNELS_DATA {
24277 #[doc = "Timestamp (time since system boot)."]
24278 pub time_boot_ms: u32,
24279 #[doc = "RC channel 1 value."]
24280 pub chan1_raw: u16,
24281 #[doc = "RC channel 2 value."]
24282 pub chan2_raw: u16,
24283 #[doc = "RC channel 3 value."]
24284 pub chan3_raw: u16,
24285 #[doc = "RC channel 4 value."]
24286 pub chan4_raw: u16,
24287 #[doc = "RC channel 5 value."]
24288 pub chan5_raw: u16,
24289 #[doc = "RC channel 6 value."]
24290 pub chan6_raw: u16,
24291 #[doc = "RC channel 7 value."]
24292 pub chan7_raw: u16,
24293 #[doc = "RC channel 8 value."]
24294 pub chan8_raw: u16,
24295 #[doc = "RC channel 9 value."]
24296 pub chan9_raw: u16,
24297 #[doc = "RC channel 10 value."]
24298 pub chan10_raw: u16,
24299 #[doc = "RC channel 11 value."]
24300 pub chan11_raw: u16,
24301 #[doc = "RC channel 12 value."]
24302 pub chan12_raw: u16,
24303 #[doc = "RC channel 13 value."]
24304 pub chan13_raw: u16,
24305 #[doc = "RC channel 14 value."]
24306 pub chan14_raw: u16,
24307 #[doc = "RC channel 15 value."]
24308 pub chan15_raw: u16,
24309 #[doc = "RC channel 16 value."]
24310 pub chan16_raw: u16,
24311 #[doc = "RC channel 17 value."]
24312 pub chan17_raw: u16,
24313 #[doc = "RC channel 18 value."]
24314 pub chan18_raw: u16,
24315 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
24316 pub chancount: u8,
24317 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24318 pub rssi: u8,
24319}
24320impl RC_CHANNELS_DATA {
24321 pub const ENCODED_LEN: usize = 42usize;
24322 pub const DEFAULT: Self = Self {
24323 time_boot_ms: 0_u32,
24324 chan1_raw: 0_u16,
24325 chan2_raw: 0_u16,
24326 chan3_raw: 0_u16,
24327 chan4_raw: 0_u16,
24328 chan5_raw: 0_u16,
24329 chan6_raw: 0_u16,
24330 chan7_raw: 0_u16,
24331 chan8_raw: 0_u16,
24332 chan9_raw: 0_u16,
24333 chan10_raw: 0_u16,
24334 chan11_raw: 0_u16,
24335 chan12_raw: 0_u16,
24336 chan13_raw: 0_u16,
24337 chan14_raw: 0_u16,
24338 chan15_raw: 0_u16,
24339 chan16_raw: 0_u16,
24340 chan17_raw: 0_u16,
24341 chan18_raw: 0_u16,
24342 chancount: 0_u8,
24343 rssi: 0_u8,
24344 };
24345 #[cfg(feature = "arbitrary")]
24346 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24347 use arbitrary::{Arbitrary, Unstructured};
24348 let mut buf = [0u8; 1024];
24349 rng.fill_bytes(&mut buf);
24350 let mut unstructured = Unstructured::new(&buf);
24351 Self::arbitrary(&mut unstructured).unwrap_or_default()
24352 }
24353}
24354impl Default for RC_CHANNELS_DATA {
24355 fn default() -> Self {
24356 Self::DEFAULT.clone()
24357 }
24358}
24359impl MessageData for RC_CHANNELS_DATA {
24360 type Message = MavMessage;
24361 const ID: u32 = 65u32;
24362 const NAME: &'static str = "RC_CHANNELS";
24363 const EXTRA_CRC: u8 = 118u8;
24364 const ENCODED_LEN: usize = 42usize;
24365 fn deser(
24366 _version: MavlinkVersion,
24367 __input: &[u8],
24368 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24369 let avail_len = __input.len();
24370 let mut payload_buf = [0; Self::ENCODED_LEN];
24371 let mut buf = if avail_len < Self::ENCODED_LEN {
24372 payload_buf[0..avail_len].copy_from_slice(__input);
24373 Bytes::new(&payload_buf)
24374 } else {
24375 Bytes::new(__input)
24376 };
24377 let mut __struct = Self::default();
24378 __struct.time_boot_ms = buf.get_u32_le();
24379 __struct.chan1_raw = buf.get_u16_le();
24380 __struct.chan2_raw = buf.get_u16_le();
24381 __struct.chan3_raw = buf.get_u16_le();
24382 __struct.chan4_raw = buf.get_u16_le();
24383 __struct.chan5_raw = buf.get_u16_le();
24384 __struct.chan6_raw = buf.get_u16_le();
24385 __struct.chan7_raw = buf.get_u16_le();
24386 __struct.chan8_raw = buf.get_u16_le();
24387 __struct.chan9_raw = buf.get_u16_le();
24388 __struct.chan10_raw = buf.get_u16_le();
24389 __struct.chan11_raw = buf.get_u16_le();
24390 __struct.chan12_raw = buf.get_u16_le();
24391 __struct.chan13_raw = buf.get_u16_le();
24392 __struct.chan14_raw = buf.get_u16_le();
24393 __struct.chan15_raw = buf.get_u16_le();
24394 __struct.chan16_raw = buf.get_u16_le();
24395 __struct.chan17_raw = buf.get_u16_le();
24396 __struct.chan18_raw = buf.get_u16_le();
24397 __struct.chancount = buf.get_u8();
24398 __struct.rssi = buf.get_u8();
24399 Ok(__struct)
24400 }
24401 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24402 let mut __tmp = BytesMut::new(bytes);
24403 #[allow(clippy::absurd_extreme_comparisons)]
24404 #[allow(unused_comparisons)]
24405 if __tmp.remaining() < Self::ENCODED_LEN {
24406 panic!(
24407 "buffer is too small (need {} bytes, but got {})",
24408 Self::ENCODED_LEN,
24409 __tmp.remaining(),
24410 )
24411 }
24412 __tmp.put_u32_le(self.time_boot_ms);
24413 __tmp.put_u16_le(self.chan1_raw);
24414 __tmp.put_u16_le(self.chan2_raw);
24415 __tmp.put_u16_le(self.chan3_raw);
24416 __tmp.put_u16_le(self.chan4_raw);
24417 __tmp.put_u16_le(self.chan5_raw);
24418 __tmp.put_u16_le(self.chan6_raw);
24419 __tmp.put_u16_le(self.chan7_raw);
24420 __tmp.put_u16_le(self.chan8_raw);
24421 __tmp.put_u16_le(self.chan9_raw);
24422 __tmp.put_u16_le(self.chan10_raw);
24423 __tmp.put_u16_le(self.chan11_raw);
24424 __tmp.put_u16_le(self.chan12_raw);
24425 __tmp.put_u16_le(self.chan13_raw);
24426 __tmp.put_u16_le(self.chan14_raw);
24427 __tmp.put_u16_le(self.chan15_raw);
24428 __tmp.put_u16_le(self.chan16_raw);
24429 __tmp.put_u16_le(self.chan17_raw);
24430 __tmp.put_u16_le(self.chan18_raw);
24431 __tmp.put_u8(self.chancount);
24432 __tmp.put_u8(self.rssi);
24433 if matches!(version, MavlinkVersion::V2) {
24434 let len = __tmp.len();
24435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24436 } else {
24437 __tmp.len()
24438 }
24439 }
24440}
24441#[doc = "id: 70"]
24442#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
24443#[derive(Debug, Clone, PartialEq)]
24444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24446pub struct RC_CHANNELS_OVERRIDE_DATA {
24447 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24448 pub chan1_raw: u16,
24449 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24450 pub chan2_raw: u16,
24451 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24452 pub chan3_raw: u16,
24453 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24454 pub chan4_raw: u16,
24455 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24456 pub chan5_raw: u16,
24457 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24458 pub chan6_raw: u16,
24459 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24460 pub chan7_raw: u16,
24461 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24462 pub chan8_raw: u16,
24463 #[doc = "System ID"]
24464 pub target_system: u8,
24465 #[doc = "Component ID"]
24466 pub target_component: u8,
24467 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24468 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24469 pub chan9_raw: u16,
24470 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24471 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24472 pub chan10_raw: u16,
24473 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24474 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24475 pub chan11_raw: u16,
24476 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24477 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24478 pub chan12_raw: u16,
24479 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24480 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24481 pub chan13_raw: u16,
24482 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24483 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24484 pub chan14_raw: u16,
24485 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24486 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24487 pub chan15_raw: u16,
24488 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24489 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24490 pub chan16_raw: u16,
24491 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24492 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24493 pub chan17_raw: u16,
24494 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24495 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24496 pub chan18_raw: u16,
24497}
24498impl RC_CHANNELS_OVERRIDE_DATA {
24499 pub const ENCODED_LEN: usize = 38usize;
24500 pub const DEFAULT: Self = Self {
24501 chan1_raw: 0_u16,
24502 chan2_raw: 0_u16,
24503 chan3_raw: 0_u16,
24504 chan4_raw: 0_u16,
24505 chan5_raw: 0_u16,
24506 chan6_raw: 0_u16,
24507 chan7_raw: 0_u16,
24508 chan8_raw: 0_u16,
24509 target_system: 0_u8,
24510 target_component: 0_u8,
24511 chan9_raw: 0_u16,
24512 chan10_raw: 0_u16,
24513 chan11_raw: 0_u16,
24514 chan12_raw: 0_u16,
24515 chan13_raw: 0_u16,
24516 chan14_raw: 0_u16,
24517 chan15_raw: 0_u16,
24518 chan16_raw: 0_u16,
24519 chan17_raw: 0_u16,
24520 chan18_raw: 0_u16,
24521 };
24522 #[cfg(feature = "arbitrary")]
24523 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24524 use arbitrary::{Arbitrary, Unstructured};
24525 let mut buf = [0u8; 1024];
24526 rng.fill_bytes(&mut buf);
24527 let mut unstructured = Unstructured::new(&buf);
24528 Self::arbitrary(&mut unstructured).unwrap_or_default()
24529 }
24530}
24531impl Default for RC_CHANNELS_OVERRIDE_DATA {
24532 fn default() -> Self {
24533 Self::DEFAULT.clone()
24534 }
24535}
24536impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
24537 type Message = MavMessage;
24538 const ID: u32 = 70u32;
24539 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
24540 const EXTRA_CRC: u8 = 124u8;
24541 const ENCODED_LEN: usize = 38usize;
24542 fn deser(
24543 _version: MavlinkVersion,
24544 __input: &[u8],
24545 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24546 let avail_len = __input.len();
24547 let mut payload_buf = [0; Self::ENCODED_LEN];
24548 let mut buf = if avail_len < Self::ENCODED_LEN {
24549 payload_buf[0..avail_len].copy_from_slice(__input);
24550 Bytes::new(&payload_buf)
24551 } else {
24552 Bytes::new(__input)
24553 };
24554 let mut __struct = Self::default();
24555 __struct.chan1_raw = buf.get_u16_le();
24556 __struct.chan2_raw = buf.get_u16_le();
24557 __struct.chan3_raw = buf.get_u16_le();
24558 __struct.chan4_raw = buf.get_u16_le();
24559 __struct.chan5_raw = buf.get_u16_le();
24560 __struct.chan6_raw = buf.get_u16_le();
24561 __struct.chan7_raw = buf.get_u16_le();
24562 __struct.chan8_raw = buf.get_u16_le();
24563 __struct.target_system = buf.get_u8();
24564 __struct.target_component = buf.get_u8();
24565 __struct.chan9_raw = buf.get_u16_le();
24566 __struct.chan10_raw = buf.get_u16_le();
24567 __struct.chan11_raw = buf.get_u16_le();
24568 __struct.chan12_raw = buf.get_u16_le();
24569 __struct.chan13_raw = buf.get_u16_le();
24570 __struct.chan14_raw = buf.get_u16_le();
24571 __struct.chan15_raw = buf.get_u16_le();
24572 __struct.chan16_raw = buf.get_u16_le();
24573 __struct.chan17_raw = buf.get_u16_le();
24574 __struct.chan18_raw = buf.get_u16_le();
24575 Ok(__struct)
24576 }
24577 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24578 let mut __tmp = BytesMut::new(bytes);
24579 #[allow(clippy::absurd_extreme_comparisons)]
24580 #[allow(unused_comparisons)]
24581 if __tmp.remaining() < Self::ENCODED_LEN {
24582 panic!(
24583 "buffer is too small (need {} bytes, but got {})",
24584 Self::ENCODED_LEN,
24585 __tmp.remaining(),
24586 )
24587 }
24588 __tmp.put_u16_le(self.chan1_raw);
24589 __tmp.put_u16_le(self.chan2_raw);
24590 __tmp.put_u16_le(self.chan3_raw);
24591 __tmp.put_u16_le(self.chan4_raw);
24592 __tmp.put_u16_le(self.chan5_raw);
24593 __tmp.put_u16_le(self.chan6_raw);
24594 __tmp.put_u16_le(self.chan7_raw);
24595 __tmp.put_u16_le(self.chan8_raw);
24596 __tmp.put_u8(self.target_system);
24597 __tmp.put_u8(self.target_component);
24598 __tmp.put_u16_le(self.chan9_raw);
24599 __tmp.put_u16_le(self.chan10_raw);
24600 __tmp.put_u16_le(self.chan11_raw);
24601 __tmp.put_u16_le(self.chan12_raw);
24602 __tmp.put_u16_le(self.chan13_raw);
24603 __tmp.put_u16_le(self.chan14_raw);
24604 __tmp.put_u16_le(self.chan15_raw);
24605 __tmp.put_u16_le(self.chan16_raw);
24606 __tmp.put_u16_le(self.chan17_raw);
24607 __tmp.put_u16_le(self.chan18_raw);
24608 if matches!(version, MavlinkVersion::V2) {
24609 let len = __tmp.len();
24610 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24611 } else {
24612 __tmp.len()
24613 }
24614 }
24615}
24616#[doc = "id: 35"]
24617#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24618#[derive(Debug, Clone, PartialEq)]
24619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24621pub struct RC_CHANNELS_RAW_DATA {
24622 #[doc = "Timestamp (time since system boot)."]
24623 pub time_boot_ms: u32,
24624 #[doc = "RC channel 1 value."]
24625 pub chan1_raw: u16,
24626 #[doc = "RC channel 2 value."]
24627 pub chan2_raw: u16,
24628 #[doc = "RC channel 3 value."]
24629 pub chan3_raw: u16,
24630 #[doc = "RC channel 4 value."]
24631 pub chan4_raw: u16,
24632 #[doc = "RC channel 5 value."]
24633 pub chan5_raw: u16,
24634 #[doc = "RC channel 6 value."]
24635 pub chan6_raw: u16,
24636 #[doc = "RC channel 7 value."]
24637 pub chan7_raw: u16,
24638 #[doc = "RC channel 8 value."]
24639 pub chan8_raw: u16,
24640 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24641 pub port: u8,
24642 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24643 pub rssi: u8,
24644}
24645impl RC_CHANNELS_RAW_DATA {
24646 pub const ENCODED_LEN: usize = 22usize;
24647 pub const DEFAULT: Self = Self {
24648 time_boot_ms: 0_u32,
24649 chan1_raw: 0_u16,
24650 chan2_raw: 0_u16,
24651 chan3_raw: 0_u16,
24652 chan4_raw: 0_u16,
24653 chan5_raw: 0_u16,
24654 chan6_raw: 0_u16,
24655 chan7_raw: 0_u16,
24656 chan8_raw: 0_u16,
24657 port: 0_u8,
24658 rssi: 0_u8,
24659 };
24660 #[cfg(feature = "arbitrary")]
24661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24662 use arbitrary::{Arbitrary, Unstructured};
24663 let mut buf = [0u8; 1024];
24664 rng.fill_bytes(&mut buf);
24665 let mut unstructured = Unstructured::new(&buf);
24666 Self::arbitrary(&mut unstructured).unwrap_or_default()
24667 }
24668}
24669impl Default for RC_CHANNELS_RAW_DATA {
24670 fn default() -> Self {
24671 Self::DEFAULT.clone()
24672 }
24673}
24674impl MessageData for RC_CHANNELS_RAW_DATA {
24675 type Message = MavMessage;
24676 const ID: u32 = 35u32;
24677 const NAME: &'static str = "RC_CHANNELS_RAW";
24678 const EXTRA_CRC: u8 = 244u8;
24679 const ENCODED_LEN: usize = 22usize;
24680 fn deser(
24681 _version: MavlinkVersion,
24682 __input: &[u8],
24683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24684 let avail_len = __input.len();
24685 let mut payload_buf = [0; Self::ENCODED_LEN];
24686 let mut buf = if avail_len < Self::ENCODED_LEN {
24687 payload_buf[0..avail_len].copy_from_slice(__input);
24688 Bytes::new(&payload_buf)
24689 } else {
24690 Bytes::new(__input)
24691 };
24692 let mut __struct = Self::default();
24693 __struct.time_boot_ms = buf.get_u32_le();
24694 __struct.chan1_raw = buf.get_u16_le();
24695 __struct.chan2_raw = buf.get_u16_le();
24696 __struct.chan3_raw = buf.get_u16_le();
24697 __struct.chan4_raw = buf.get_u16_le();
24698 __struct.chan5_raw = buf.get_u16_le();
24699 __struct.chan6_raw = buf.get_u16_le();
24700 __struct.chan7_raw = buf.get_u16_le();
24701 __struct.chan8_raw = buf.get_u16_le();
24702 __struct.port = buf.get_u8();
24703 __struct.rssi = buf.get_u8();
24704 Ok(__struct)
24705 }
24706 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24707 let mut __tmp = BytesMut::new(bytes);
24708 #[allow(clippy::absurd_extreme_comparisons)]
24709 #[allow(unused_comparisons)]
24710 if __tmp.remaining() < Self::ENCODED_LEN {
24711 panic!(
24712 "buffer is too small (need {} bytes, but got {})",
24713 Self::ENCODED_LEN,
24714 __tmp.remaining(),
24715 )
24716 }
24717 __tmp.put_u32_le(self.time_boot_ms);
24718 __tmp.put_u16_le(self.chan1_raw);
24719 __tmp.put_u16_le(self.chan2_raw);
24720 __tmp.put_u16_le(self.chan3_raw);
24721 __tmp.put_u16_le(self.chan4_raw);
24722 __tmp.put_u16_le(self.chan5_raw);
24723 __tmp.put_u16_le(self.chan6_raw);
24724 __tmp.put_u16_le(self.chan7_raw);
24725 __tmp.put_u16_le(self.chan8_raw);
24726 __tmp.put_u8(self.port);
24727 __tmp.put_u8(self.rssi);
24728 if matches!(version, MavlinkVersion::V2) {
24729 let len = __tmp.len();
24730 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24731 } else {
24732 __tmp.len()
24733 }
24734 }
24735}
24736#[doc = "id: 34"]
24737#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
24738#[derive(Debug, Clone, PartialEq)]
24739#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24741pub struct RC_CHANNELS_SCALED_DATA {
24742 #[doc = "Timestamp (time since system boot)."]
24743 pub time_boot_ms: u32,
24744 #[doc = "RC channel 1 value scaled."]
24745 pub chan1_scaled: i16,
24746 #[doc = "RC channel 2 value scaled."]
24747 pub chan2_scaled: i16,
24748 #[doc = "RC channel 3 value scaled."]
24749 pub chan3_scaled: i16,
24750 #[doc = "RC channel 4 value scaled."]
24751 pub chan4_scaled: i16,
24752 #[doc = "RC channel 5 value scaled."]
24753 pub chan5_scaled: i16,
24754 #[doc = "RC channel 6 value scaled."]
24755 pub chan6_scaled: i16,
24756 #[doc = "RC channel 7 value scaled."]
24757 pub chan7_scaled: i16,
24758 #[doc = "RC channel 8 value scaled."]
24759 pub chan8_scaled: i16,
24760 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24761 pub port: u8,
24762 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24763 pub rssi: u8,
24764}
24765impl RC_CHANNELS_SCALED_DATA {
24766 pub const ENCODED_LEN: usize = 22usize;
24767 pub const DEFAULT: Self = Self {
24768 time_boot_ms: 0_u32,
24769 chan1_scaled: 0_i16,
24770 chan2_scaled: 0_i16,
24771 chan3_scaled: 0_i16,
24772 chan4_scaled: 0_i16,
24773 chan5_scaled: 0_i16,
24774 chan6_scaled: 0_i16,
24775 chan7_scaled: 0_i16,
24776 chan8_scaled: 0_i16,
24777 port: 0_u8,
24778 rssi: 0_u8,
24779 };
24780 #[cfg(feature = "arbitrary")]
24781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24782 use arbitrary::{Arbitrary, Unstructured};
24783 let mut buf = [0u8; 1024];
24784 rng.fill_bytes(&mut buf);
24785 let mut unstructured = Unstructured::new(&buf);
24786 Self::arbitrary(&mut unstructured).unwrap_or_default()
24787 }
24788}
24789impl Default for RC_CHANNELS_SCALED_DATA {
24790 fn default() -> Self {
24791 Self::DEFAULT.clone()
24792 }
24793}
24794impl MessageData for RC_CHANNELS_SCALED_DATA {
24795 type Message = MavMessage;
24796 const ID: u32 = 34u32;
24797 const NAME: &'static str = "RC_CHANNELS_SCALED";
24798 const EXTRA_CRC: u8 = 237u8;
24799 const ENCODED_LEN: usize = 22usize;
24800 fn deser(
24801 _version: MavlinkVersion,
24802 __input: &[u8],
24803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24804 let avail_len = __input.len();
24805 let mut payload_buf = [0; Self::ENCODED_LEN];
24806 let mut buf = if avail_len < Self::ENCODED_LEN {
24807 payload_buf[0..avail_len].copy_from_slice(__input);
24808 Bytes::new(&payload_buf)
24809 } else {
24810 Bytes::new(__input)
24811 };
24812 let mut __struct = Self::default();
24813 __struct.time_boot_ms = buf.get_u32_le();
24814 __struct.chan1_scaled = buf.get_i16_le();
24815 __struct.chan2_scaled = buf.get_i16_le();
24816 __struct.chan3_scaled = buf.get_i16_le();
24817 __struct.chan4_scaled = buf.get_i16_le();
24818 __struct.chan5_scaled = buf.get_i16_le();
24819 __struct.chan6_scaled = buf.get_i16_le();
24820 __struct.chan7_scaled = buf.get_i16_le();
24821 __struct.chan8_scaled = buf.get_i16_le();
24822 __struct.port = buf.get_u8();
24823 __struct.rssi = buf.get_u8();
24824 Ok(__struct)
24825 }
24826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24827 let mut __tmp = BytesMut::new(bytes);
24828 #[allow(clippy::absurd_extreme_comparisons)]
24829 #[allow(unused_comparisons)]
24830 if __tmp.remaining() < Self::ENCODED_LEN {
24831 panic!(
24832 "buffer is too small (need {} bytes, but got {})",
24833 Self::ENCODED_LEN,
24834 __tmp.remaining(),
24835 )
24836 }
24837 __tmp.put_u32_le(self.time_boot_ms);
24838 __tmp.put_i16_le(self.chan1_scaled);
24839 __tmp.put_i16_le(self.chan2_scaled);
24840 __tmp.put_i16_le(self.chan3_scaled);
24841 __tmp.put_i16_le(self.chan4_scaled);
24842 __tmp.put_i16_le(self.chan5_scaled);
24843 __tmp.put_i16_le(self.chan6_scaled);
24844 __tmp.put_i16_le(self.chan7_scaled);
24845 __tmp.put_i16_le(self.chan8_scaled);
24846 __tmp.put_u8(self.port);
24847 __tmp.put_u8(self.rssi);
24848 if matches!(version, MavlinkVersion::V2) {
24849 let len = __tmp.len();
24850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24851 } else {
24852 __tmp.len()
24853 }
24854 }
24855}
24856#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
24857#[doc = "id: 66"]
24858#[doc = "Request a data stream."]
24859#[derive(Debug, Clone, PartialEq)]
24860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24862pub struct REQUEST_DATA_STREAM_DATA {
24863 #[doc = "The requested message rate"]
24864 pub req_message_rate: u16,
24865 #[doc = "The target requested to send the message stream."]
24866 pub target_system: u8,
24867 #[doc = "The target requested to send the message stream."]
24868 pub target_component: u8,
24869 #[doc = "The ID of the requested data stream"]
24870 pub req_stream_id: u8,
24871 #[doc = "1 to start sending, 0 to stop sending."]
24872 pub start_stop: u8,
24873}
24874impl REQUEST_DATA_STREAM_DATA {
24875 pub const ENCODED_LEN: usize = 6usize;
24876 pub const DEFAULT: Self = Self {
24877 req_message_rate: 0_u16,
24878 target_system: 0_u8,
24879 target_component: 0_u8,
24880 req_stream_id: 0_u8,
24881 start_stop: 0_u8,
24882 };
24883 #[cfg(feature = "arbitrary")]
24884 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24885 use arbitrary::{Arbitrary, Unstructured};
24886 let mut buf = [0u8; 1024];
24887 rng.fill_bytes(&mut buf);
24888 let mut unstructured = Unstructured::new(&buf);
24889 Self::arbitrary(&mut unstructured).unwrap_or_default()
24890 }
24891}
24892impl Default for REQUEST_DATA_STREAM_DATA {
24893 fn default() -> Self {
24894 Self::DEFAULT.clone()
24895 }
24896}
24897impl MessageData for REQUEST_DATA_STREAM_DATA {
24898 type Message = MavMessage;
24899 const ID: u32 = 66u32;
24900 const NAME: &'static str = "REQUEST_DATA_STREAM";
24901 const EXTRA_CRC: u8 = 148u8;
24902 const ENCODED_LEN: usize = 6usize;
24903 fn deser(
24904 _version: MavlinkVersion,
24905 __input: &[u8],
24906 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24907 let avail_len = __input.len();
24908 let mut payload_buf = [0; Self::ENCODED_LEN];
24909 let mut buf = if avail_len < Self::ENCODED_LEN {
24910 payload_buf[0..avail_len].copy_from_slice(__input);
24911 Bytes::new(&payload_buf)
24912 } else {
24913 Bytes::new(__input)
24914 };
24915 let mut __struct = Self::default();
24916 __struct.req_message_rate = buf.get_u16_le();
24917 __struct.target_system = buf.get_u8();
24918 __struct.target_component = buf.get_u8();
24919 __struct.req_stream_id = buf.get_u8();
24920 __struct.start_stop = buf.get_u8();
24921 Ok(__struct)
24922 }
24923 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24924 let mut __tmp = BytesMut::new(bytes);
24925 #[allow(clippy::absurd_extreme_comparisons)]
24926 #[allow(unused_comparisons)]
24927 if __tmp.remaining() < Self::ENCODED_LEN {
24928 panic!(
24929 "buffer is too small (need {} bytes, but got {})",
24930 Self::ENCODED_LEN,
24931 __tmp.remaining(),
24932 )
24933 }
24934 __tmp.put_u16_le(self.req_message_rate);
24935 __tmp.put_u8(self.target_system);
24936 __tmp.put_u8(self.target_component);
24937 __tmp.put_u8(self.req_stream_id);
24938 __tmp.put_u8(self.start_stop);
24939 if matches!(version, MavlinkVersion::V2) {
24940 let len = __tmp.len();
24941 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24942 } else {
24943 __tmp.len()
24944 }
24945 }
24946}
24947#[doc = "id: 412"]
24948#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
24949#[derive(Debug, Clone, PartialEq)]
24950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24952pub struct REQUEST_EVENT_DATA {
24953 #[doc = "First sequence number of the requested event."]
24954 pub first_sequence: u16,
24955 #[doc = "Last sequence number of the requested event."]
24956 pub last_sequence: u16,
24957 #[doc = "System ID"]
24958 pub target_system: u8,
24959 #[doc = "Component ID"]
24960 pub target_component: u8,
24961}
24962impl REQUEST_EVENT_DATA {
24963 pub const ENCODED_LEN: usize = 6usize;
24964 pub const DEFAULT: Self = Self {
24965 first_sequence: 0_u16,
24966 last_sequence: 0_u16,
24967 target_system: 0_u8,
24968 target_component: 0_u8,
24969 };
24970 #[cfg(feature = "arbitrary")]
24971 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24972 use arbitrary::{Arbitrary, Unstructured};
24973 let mut buf = [0u8; 1024];
24974 rng.fill_bytes(&mut buf);
24975 let mut unstructured = Unstructured::new(&buf);
24976 Self::arbitrary(&mut unstructured).unwrap_or_default()
24977 }
24978}
24979impl Default for REQUEST_EVENT_DATA {
24980 fn default() -> Self {
24981 Self::DEFAULT.clone()
24982 }
24983}
24984impl MessageData for REQUEST_EVENT_DATA {
24985 type Message = MavMessage;
24986 const ID: u32 = 412u32;
24987 const NAME: &'static str = "REQUEST_EVENT";
24988 const EXTRA_CRC: u8 = 33u8;
24989 const ENCODED_LEN: usize = 6usize;
24990 fn deser(
24991 _version: MavlinkVersion,
24992 __input: &[u8],
24993 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24994 let avail_len = __input.len();
24995 let mut payload_buf = [0; Self::ENCODED_LEN];
24996 let mut buf = if avail_len < Self::ENCODED_LEN {
24997 payload_buf[0..avail_len].copy_from_slice(__input);
24998 Bytes::new(&payload_buf)
24999 } else {
25000 Bytes::new(__input)
25001 };
25002 let mut __struct = Self::default();
25003 __struct.first_sequence = buf.get_u16_le();
25004 __struct.last_sequence = buf.get_u16_le();
25005 __struct.target_system = buf.get_u8();
25006 __struct.target_component = buf.get_u8();
25007 Ok(__struct)
25008 }
25009 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25010 let mut __tmp = BytesMut::new(bytes);
25011 #[allow(clippy::absurd_extreme_comparisons)]
25012 #[allow(unused_comparisons)]
25013 if __tmp.remaining() < Self::ENCODED_LEN {
25014 panic!(
25015 "buffer is too small (need {} bytes, but got {})",
25016 Self::ENCODED_LEN,
25017 __tmp.remaining(),
25018 )
25019 }
25020 __tmp.put_u16_le(self.first_sequence);
25021 __tmp.put_u16_le(self.last_sequence);
25022 __tmp.put_u8(self.target_system);
25023 __tmp.put_u8(self.target_component);
25024 if matches!(version, MavlinkVersion::V2) {
25025 let len = __tmp.len();
25026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25027 } else {
25028 __tmp.len()
25029 }
25030 }
25031}
25032#[doc = "id: 142"]
25033#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
25034#[derive(Debug, Clone, PartialEq)]
25035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25037pub struct RESOURCE_REQUEST_DATA {
25038 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
25039 pub request_id: u8,
25040 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
25041 pub uri_type: u8,
25042 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
25043 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25044 pub uri: [u8; 120],
25045 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
25046 pub transfer_type: u8,
25047 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
25048 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25049 pub storage: [u8; 120],
25050}
25051impl RESOURCE_REQUEST_DATA {
25052 pub const ENCODED_LEN: usize = 243usize;
25053 pub const DEFAULT: Self = Self {
25054 request_id: 0_u8,
25055 uri_type: 0_u8,
25056 uri: [0_u8; 120usize],
25057 transfer_type: 0_u8,
25058 storage: [0_u8; 120usize],
25059 };
25060 #[cfg(feature = "arbitrary")]
25061 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25062 use arbitrary::{Arbitrary, Unstructured};
25063 let mut buf = [0u8; 1024];
25064 rng.fill_bytes(&mut buf);
25065 let mut unstructured = Unstructured::new(&buf);
25066 Self::arbitrary(&mut unstructured).unwrap_or_default()
25067 }
25068}
25069impl Default for RESOURCE_REQUEST_DATA {
25070 fn default() -> Self {
25071 Self::DEFAULT.clone()
25072 }
25073}
25074impl MessageData for RESOURCE_REQUEST_DATA {
25075 type Message = MavMessage;
25076 const ID: u32 = 142u32;
25077 const NAME: &'static str = "RESOURCE_REQUEST";
25078 const EXTRA_CRC: u8 = 72u8;
25079 const ENCODED_LEN: usize = 243usize;
25080 fn deser(
25081 _version: MavlinkVersion,
25082 __input: &[u8],
25083 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25084 let avail_len = __input.len();
25085 let mut payload_buf = [0; Self::ENCODED_LEN];
25086 let mut buf = if avail_len < Self::ENCODED_LEN {
25087 payload_buf[0..avail_len].copy_from_slice(__input);
25088 Bytes::new(&payload_buf)
25089 } else {
25090 Bytes::new(__input)
25091 };
25092 let mut __struct = Self::default();
25093 __struct.request_id = buf.get_u8();
25094 __struct.uri_type = buf.get_u8();
25095 for v in &mut __struct.uri {
25096 let val = buf.get_u8();
25097 *v = val;
25098 }
25099 __struct.transfer_type = buf.get_u8();
25100 for v in &mut __struct.storage {
25101 let val = buf.get_u8();
25102 *v = val;
25103 }
25104 Ok(__struct)
25105 }
25106 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25107 let mut __tmp = BytesMut::new(bytes);
25108 #[allow(clippy::absurd_extreme_comparisons)]
25109 #[allow(unused_comparisons)]
25110 if __tmp.remaining() < Self::ENCODED_LEN {
25111 panic!(
25112 "buffer is too small (need {} bytes, but got {})",
25113 Self::ENCODED_LEN,
25114 __tmp.remaining(),
25115 )
25116 }
25117 __tmp.put_u8(self.request_id);
25118 __tmp.put_u8(self.uri_type);
25119 for val in &self.uri {
25120 __tmp.put_u8(*val);
25121 }
25122 __tmp.put_u8(self.transfer_type);
25123 for val in &self.storage {
25124 __tmp.put_u8(*val);
25125 }
25126 if matches!(version, MavlinkVersion::V2) {
25127 let len = __tmp.len();
25128 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25129 } else {
25130 __tmp.len()
25131 }
25132 }
25133}
25134#[doc = "id: 413"]
25135#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
25136#[derive(Debug, Clone, PartialEq)]
25137#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25139pub struct RESPONSE_EVENT_ERROR_DATA {
25140 #[doc = "Sequence number."]
25141 pub sequence: u16,
25142 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
25143 pub sequence_oldest_available: u16,
25144 #[doc = "System ID"]
25145 pub target_system: u8,
25146 #[doc = "Component ID"]
25147 pub target_component: u8,
25148 #[doc = "Error reason."]
25149 pub reason: MavEventErrorReason,
25150}
25151impl RESPONSE_EVENT_ERROR_DATA {
25152 pub const ENCODED_LEN: usize = 7usize;
25153 pub const DEFAULT: Self = Self {
25154 sequence: 0_u16,
25155 sequence_oldest_available: 0_u16,
25156 target_system: 0_u8,
25157 target_component: 0_u8,
25158 reason: MavEventErrorReason::DEFAULT,
25159 };
25160 #[cfg(feature = "arbitrary")]
25161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25162 use arbitrary::{Arbitrary, Unstructured};
25163 let mut buf = [0u8; 1024];
25164 rng.fill_bytes(&mut buf);
25165 let mut unstructured = Unstructured::new(&buf);
25166 Self::arbitrary(&mut unstructured).unwrap_or_default()
25167 }
25168}
25169impl Default for RESPONSE_EVENT_ERROR_DATA {
25170 fn default() -> Self {
25171 Self::DEFAULT.clone()
25172 }
25173}
25174impl MessageData for RESPONSE_EVENT_ERROR_DATA {
25175 type Message = MavMessage;
25176 const ID: u32 = 413u32;
25177 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
25178 const EXTRA_CRC: u8 = 77u8;
25179 const ENCODED_LEN: usize = 7usize;
25180 fn deser(
25181 _version: MavlinkVersion,
25182 __input: &[u8],
25183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25184 let avail_len = __input.len();
25185 let mut payload_buf = [0; Self::ENCODED_LEN];
25186 let mut buf = if avail_len < Self::ENCODED_LEN {
25187 payload_buf[0..avail_len].copy_from_slice(__input);
25188 Bytes::new(&payload_buf)
25189 } else {
25190 Bytes::new(__input)
25191 };
25192 let mut __struct = Self::default();
25193 __struct.sequence = buf.get_u16_le();
25194 __struct.sequence_oldest_available = buf.get_u16_le();
25195 __struct.target_system = buf.get_u8();
25196 __struct.target_component = buf.get_u8();
25197 let tmp = buf.get_u8();
25198 __struct.reason =
25199 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25200 enum_type: "MavEventErrorReason",
25201 value: tmp as u32,
25202 })?;
25203 Ok(__struct)
25204 }
25205 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25206 let mut __tmp = BytesMut::new(bytes);
25207 #[allow(clippy::absurd_extreme_comparisons)]
25208 #[allow(unused_comparisons)]
25209 if __tmp.remaining() < Self::ENCODED_LEN {
25210 panic!(
25211 "buffer is too small (need {} bytes, but got {})",
25212 Self::ENCODED_LEN,
25213 __tmp.remaining(),
25214 )
25215 }
25216 __tmp.put_u16_le(self.sequence);
25217 __tmp.put_u16_le(self.sequence_oldest_available);
25218 __tmp.put_u8(self.target_system);
25219 __tmp.put_u8(self.target_component);
25220 __tmp.put_u8(self.reason as u8);
25221 if matches!(version, MavlinkVersion::V2) {
25222 let len = __tmp.len();
25223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25224 } else {
25225 __tmp.len()
25226 }
25227 }
25228}
25229#[doc = "id: 55"]
25230#[doc = "Read out the safety zone the MAV currently assumes."]
25231#[derive(Debug, Clone, PartialEq)]
25232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25234pub struct SAFETY_ALLOWED_AREA_DATA {
25235 #[doc = "x position 1 / Latitude 1"]
25236 pub p1x: f32,
25237 #[doc = "y position 1 / Longitude 1"]
25238 pub p1y: f32,
25239 #[doc = "z position 1 / Altitude 1"]
25240 pub p1z: f32,
25241 #[doc = "x position 2 / Latitude 2"]
25242 pub p2x: f32,
25243 #[doc = "y position 2 / Longitude 2"]
25244 pub p2y: f32,
25245 #[doc = "z position 2 / Altitude 2"]
25246 pub p2z: f32,
25247 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25248 pub frame: MavFrame,
25249}
25250impl SAFETY_ALLOWED_AREA_DATA {
25251 pub const ENCODED_LEN: usize = 25usize;
25252 pub const DEFAULT: Self = Self {
25253 p1x: 0.0_f32,
25254 p1y: 0.0_f32,
25255 p1z: 0.0_f32,
25256 p2x: 0.0_f32,
25257 p2y: 0.0_f32,
25258 p2z: 0.0_f32,
25259 frame: MavFrame::DEFAULT,
25260 };
25261 #[cfg(feature = "arbitrary")]
25262 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25263 use arbitrary::{Arbitrary, Unstructured};
25264 let mut buf = [0u8; 1024];
25265 rng.fill_bytes(&mut buf);
25266 let mut unstructured = Unstructured::new(&buf);
25267 Self::arbitrary(&mut unstructured).unwrap_or_default()
25268 }
25269}
25270impl Default for SAFETY_ALLOWED_AREA_DATA {
25271 fn default() -> Self {
25272 Self::DEFAULT.clone()
25273 }
25274}
25275impl MessageData for SAFETY_ALLOWED_AREA_DATA {
25276 type Message = MavMessage;
25277 const ID: u32 = 55u32;
25278 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
25279 const EXTRA_CRC: u8 = 3u8;
25280 const ENCODED_LEN: usize = 25usize;
25281 fn deser(
25282 _version: MavlinkVersion,
25283 __input: &[u8],
25284 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25285 let avail_len = __input.len();
25286 let mut payload_buf = [0; Self::ENCODED_LEN];
25287 let mut buf = if avail_len < Self::ENCODED_LEN {
25288 payload_buf[0..avail_len].copy_from_slice(__input);
25289 Bytes::new(&payload_buf)
25290 } else {
25291 Bytes::new(__input)
25292 };
25293 let mut __struct = Self::default();
25294 __struct.p1x = buf.get_f32_le();
25295 __struct.p1y = buf.get_f32_le();
25296 __struct.p1z = buf.get_f32_le();
25297 __struct.p2x = buf.get_f32_le();
25298 __struct.p2y = buf.get_f32_le();
25299 __struct.p2z = buf.get_f32_le();
25300 let tmp = buf.get_u8();
25301 __struct.frame =
25302 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25303 enum_type: "MavFrame",
25304 value: tmp as u32,
25305 })?;
25306 Ok(__struct)
25307 }
25308 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25309 let mut __tmp = BytesMut::new(bytes);
25310 #[allow(clippy::absurd_extreme_comparisons)]
25311 #[allow(unused_comparisons)]
25312 if __tmp.remaining() < Self::ENCODED_LEN {
25313 panic!(
25314 "buffer is too small (need {} bytes, but got {})",
25315 Self::ENCODED_LEN,
25316 __tmp.remaining(),
25317 )
25318 }
25319 __tmp.put_f32_le(self.p1x);
25320 __tmp.put_f32_le(self.p1y);
25321 __tmp.put_f32_le(self.p1z);
25322 __tmp.put_f32_le(self.p2x);
25323 __tmp.put_f32_le(self.p2y);
25324 __tmp.put_f32_le(self.p2z);
25325 __tmp.put_u8(self.frame as u8);
25326 if matches!(version, MavlinkVersion::V2) {
25327 let len = __tmp.len();
25328 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25329 } else {
25330 __tmp.len()
25331 }
25332 }
25333}
25334#[doc = "id: 54"]
25335#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
25336#[derive(Debug, Clone, PartialEq)]
25337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25338#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25339pub struct SAFETY_SET_ALLOWED_AREA_DATA {
25340 #[doc = "x position 1 / Latitude 1"]
25341 pub p1x: f32,
25342 #[doc = "y position 1 / Longitude 1"]
25343 pub p1y: f32,
25344 #[doc = "z position 1 / Altitude 1"]
25345 pub p1z: f32,
25346 #[doc = "x position 2 / Latitude 2"]
25347 pub p2x: f32,
25348 #[doc = "y position 2 / Longitude 2"]
25349 pub p2y: f32,
25350 #[doc = "z position 2 / Altitude 2"]
25351 pub p2z: f32,
25352 #[doc = "System ID"]
25353 pub target_system: u8,
25354 #[doc = "Component ID"]
25355 pub target_component: u8,
25356 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25357 pub frame: MavFrame,
25358}
25359impl SAFETY_SET_ALLOWED_AREA_DATA {
25360 pub const ENCODED_LEN: usize = 27usize;
25361 pub const DEFAULT: Self = Self {
25362 p1x: 0.0_f32,
25363 p1y: 0.0_f32,
25364 p1z: 0.0_f32,
25365 p2x: 0.0_f32,
25366 p2y: 0.0_f32,
25367 p2z: 0.0_f32,
25368 target_system: 0_u8,
25369 target_component: 0_u8,
25370 frame: MavFrame::DEFAULT,
25371 };
25372 #[cfg(feature = "arbitrary")]
25373 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25374 use arbitrary::{Arbitrary, Unstructured};
25375 let mut buf = [0u8; 1024];
25376 rng.fill_bytes(&mut buf);
25377 let mut unstructured = Unstructured::new(&buf);
25378 Self::arbitrary(&mut unstructured).unwrap_or_default()
25379 }
25380}
25381impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
25382 fn default() -> Self {
25383 Self::DEFAULT.clone()
25384 }
25385}
25386impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
25387 type Message = MavMessage;
25388 const ID: u32 = 54u32;
25389 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
25390 const EXTRA_CRC: u8 = 15u8;
25391 const ENCODED_LEN: usize = 27usize;
25392 fn deser(
25393 _version: MavlinkVersion,
25394 __input: &[u8],
25395 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25396 let avail_len = __input.len();
25397 let mut payload_buf = [0; Self::ENCODED_LEN];
25398 let mut buf = if avail_len < Self::ENCODED_LEN {
25399 payload_buf[0..avail_len].copy_from_slice(__input);
25400 Bytes::new(&payload_buf)
25401 } else {
25402 Bytes::new(__input)
25403 };
25404 let mut __struct = Self::default();
25405 __struct.p1x = buf.get_f32_le();
25406 __struct.p1y = buf.get_f32_le();
25407 __struct.p1z = buf.get_f32_le();
25408 __struct.p2x = buf.get_f32_le();
25409 __struct.p2y = buf.get_f32_le();
25410 __struct.p2z = buf.get_f32_le();
25411 __struct.target_system = buf.get_u8();
25412 __struct.target_component = buf.get_u8();
25413 let tmp = buf.get_u8();
25414 __struct.frame =
25415 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25416 enum_type: "MavFrame",
25417 value: tmp as u32,
25418 })?;
25419 Ok(__struct)
25420 }
25421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25422 let mut __tmp = BytesMut::new(bytes);
25423 #[allow(clippy::absurd_extreme_comparisons)]
25424 #[allow(unused_comparisons)]
25425 if __tmp.remaining() < Self::ENCODED_LEN {
25426 panic!(
25427 "buffer is too small (need {} bytes, but got {})",
25428 Self::ENCODED_LEN,
25429 __tmp.remaining(),
25430 )
25431 }
25432 __tmp.put_f32_le(self.p1x);
25433 __tmp.put_f32_le(self.p1y);
25434 __tmp.put_f32_le(self.p1z);
25435 __tmp.put_f32_le(self.p2x);
25436 __tmp.put_f32_le(self.p2y);
25437 __tmp.put_f32_le(self.p2z);
25438 __tmp.put_u8(self.target_system);
25439 __tmp.put_u8(self.target_component);
25440 __tmp.put_u8(self.frame as u8);
25441 if matches!(version, MavlinkVersion::V2) {
25442 let len = __tmp.len();
25443 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25444 } else {
25445 __tmp.len()
25446 }
25447 }
25448}
25449#[doc = "id: 26"]
25450#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
25451#[derive(Debug, Clone, PartialEq)]
25452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25454pub struct SCALED_IMU_DATA {
25455 #[doc = "Timestamp (time since system boot)."]
25456 pub time_boot_ms: u32,
25457 #[doc = "X acceleration"]
25458 pub xacc: i16,
25459 #[doc = "Y acceleration"]
25460 pub yacc: i16,
25461 #[doc = "Z acceleration"]
25462 pub zacc: i16,
25463 #[doc = "Angular speed around X axis"]
25464 pub xgyro: i16,
25465 #[doc = "Angular speed around Y axis"]
25466 pub ygyro: i16,
25467 #[doc = "Angular speed around Z axis"]
25468 pub zgyro: i16,
25469 #[doc = "X Magnetic field"]
25470 pub xmag: i16,
25471 #[doc = "Y Magnetic field"]
25472 pub ymag: i16,
25473 #[doc = "Z Magnetic field"]
25474 pub zmag: i16,
25475 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25476 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25477 pub temperature: i16,
25478}
25479impl SCALED_IMU_DATA {
25480 pub const ENCODED_LEN: usize = 24usize;
25481 pub const DEFAULT: Self = Self {
25482 time_boot_ms: 0_u32,
25483 xacc: 0_i16,
25484 yacc: 0_i16,
25485 zacc: 0_i16,
25486 xgyro: 0_i16,
25487 ygyro: 0_i16,
25488 zgyro: 0_i16,
25489 xmag: 0_i16,
25490 ymag: 0_i16,
25491 zmag: 0_i16,
25492 temperature: 0_i16,
25493 };
25494 #[cfg(feature = "arbitrary")]
25495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25496 use arbitrary::{Arbitrary, Unstructured};
25497 let mut buf = [0u8; 1024];
25498 rng.fill_bytes(&mut buf);
25499 let mut unstructured = Unstructured::new(&buf);
25500 Self::arbitrary(&mut unstructured).unwrap_or_default()
25501 }
25502}
25503impl Default for SCALED_IMU_DATA {
25504 fn default() -> Self {
25505 Self::DEFAULT.clone()
25506 }
25507}
25508impl MessageData for SCALED_IMU_DATA {
25509 type Message = MavMessage;
25510 const ID: u32 = 26u32;
25511 const NAME: &'static str = "SCALED_IMU";
25512 const EXTRA_CRC: u8 = 170u8;
25513 const ENCODED_LEN: usize = 24usize;
25514 fn deser(
25515 _version: MavlinkVersion,
25516 __input: &[u8],
25517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25518 let avail_len = __input.len();
25519 let mut payload_buf = [0; Self::ENCODED_LEN];
25520 let mut buf = if avail_len < Self::ENCODED_LEN {
25521 payload_buf[0..avail_len].copy_from_slice(__input);
25522 Bytes::new(&payload_buf)
25523 } else {
25524 Bytes::new(__input)
25525 };
25526 let mut __struct = Self::default();
25527 __struct.time_boot_ms = buf.get_u32_le();
25528 __struct.xacc = buf.get_i16_le();
25529 __struct.yacc = buf.get_i16_le();
25530 __struct.zacc = buf.get_i16_le();
25531 __struct.xgyro = buf.get_i16_le();
25532 __struct.ygyro = buf.get_i16_le();
25533 __struct.zgyro = buf.get_i16_le();
25534 __struct.xmag = buf.get_i16_le();
25535 __struct.ymag = buf.get_i16_le();
25536 __struct.zmag = buf.get_i16_le();
25537 __struct.temperature = buf.get_i16_le();
25538 Ok(__struct)
25539 }
25540 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25541 let mut __tmp = BytesMut::new(bytes);
25542 #[allow(clippy::absurd_extreme_comparisons)]
25543 #[allow(unused_comparisons)]
25544 if __tmp.remaining() < Self::ENCODED_LEN {
25545 panic!(
25546 "buffer is too small (need {} bytes, but got {})",
25547 Self::ENCODED_LEN,
25548 __tmp.remaining(),
25549 )
25550 }
25551 __tmp.put_u32_le(self.time_boot_ms);
25552 __tmp.put_i16_le(self.xacc);
25553 __tmp.put_i16_le(self.yacc);
25554 __tmp.put_i16_le(self.zacc);
25555 __tmp.put_i16_le(self.xgyro);
25556 __tmp.put_i16_le(self.ygyro);
25557 __tmp.put_i16_le(self.zgyro);
25558 __tmp.put_i16_le(self.xmag);
25559 __tmp.put_i16_le(self.ymag);
25560 __tmp.put_i16_le(self.zmag);
25561 __tmp.put_i16_le(self.temperature);
25562 if matches!(version, MavlinkVersion::V2) {
25563 let len = __tmp.len();
25564 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25565 } else {
25566 __tmp.len()
25567 }
25568 }
25569}
25570#[doc = "id: 116"]
25571#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
25572#[derive(Debug, Clone, PartialEq)]
25573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25574#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25575pub struct SCALED_IMU2_DATA {
25576 #[doc = "Timestamp (time since system boot)."]
25577 pub time_boot_ms: u32,
25578 #[doc = "X acceleration"]
25579 pub xacc: i16,
25580 #[doc = "Y acceleration"]
25581 pub yacc: i16,
25582 #[doc = "Z acceleration"]
25583 pub zacc: i16,
25584 #[doc = "Angular speed around X axis"]
25585 pub xgyro: i16,
25586 #[doc = "Angular speed around Y axis"]
25587 pub ygyro: i16,
25588 #[doc = "Angular speed around Z axis"]
25589 pub zgyro: i16,
25590 #[doc = "X Magnetic field"]
25591 pub xmag: i16,
25592 #[doc = "Y Magnetic field"]
25593 pub ymag: i16,
25594 #[doc = "Z Magnetic field"]
25595 pub zmag: i16,
25596 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25597 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25598 pub temperature: i16,
25599}
25600impl SCALED_IMU2_DATA {
25601 pub const ENCODED_LEN: usize = 24usize;
25602 pub const DEFAULT: Self = Self {
25603 time_boot_ms: 0_u32,
25604 xacc: 0_i16,
25605 yacc: 0_i16,
25606 zacc: 0_i16,
25607 xgyro: 0_i16,
25608 ygyro: 0_i16,
25609 zgyro: 0_i16,
25610 xmag: 0_i16,
25611 ymag: 0_i16,
25612 zmag: 0_i16,
25613 temperature: 0_i16,
25614 };
25615 #[cfg(feature = "arbitrary")]
25616 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25617 use arbitrary::{Arbitrary, Unstructured};
25618 let mut buf = [0u8; 1024];
25619 rng.fill_bytes(&mut buf);
25620 let mut unstructured = Unstructured::new(&buf);
25621 Self::arbitrary(&mut unstructured).unwrap_or_default()
25622 }
25623}
25624impl Default for SCALED_IMU2_DATA {
25625 fn default() -> Self {
25626 Self::DEFAULT.clone()
25627 }
25628}
25629impl MessageData for SCALED_IMU2_DATA {
25630 type Message = MavMessage;
25631 const ID: u32 = 116u32;
25632 const NAME: &'static str = "SCALED_IMU2";
25633 const EXTRA_CRC: u8 = 76u8;
25634 const ENCODED_LEN: usize = 24usize;
25635 fn deser(
25636 _version: MavlinkVersion,
25637 __input: &[u8],
25638 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25639 let avail_len = __input.len();
25640 let mut payload_buf = [0; Self::ENCODED_LEN];
25641 let mut buf = if avail_len < Self::ENCODED_LEN {
25642 payload_buf[0..avail_len].copy_from_slice(__input);
25643 Bytes::new(&payload_buf)
25644 } else {
25645 Bytes::new(__input)
25646 };
25647 let mut __struct = Self::default();
25648 __struct.time_boot_ms = buf.get_u32_le();
25649 __struct.xacc = buf.get_i16_le();
25650 __struct.yacc = buf.get_i16_le();
25651 __struct.zacc = buf.get_i16_le();
25652 __struct.xgyro = buf.get_i16_le();
25653 __struct.ygyro = buf.get_i16_le();
25654 __struct.zgyro = buf.get_i16_le();
25655 __struct.xmag = buf.get_i16_le();
25656 __struct.ymag = buf.get_i16_le();
25657 __struct.zmag = buf.get_i16_le();
25658 __struct.temperature = buf.get_i16_le();
25659 Ok(__struct)
25660 }
25661 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25662 let mut __tmp = BytesMut::new(bytes);
25663 #[allow(clippy::absurd_extreme_comparisons)]
25664 #[allow(unused_comparisons)]
25665 if __tmp.remaining() < Self::ENCODED_LEN {
25666 panic!(
25667 "buffer is too small (need {} bytes, but got {})",
25668 Self::ENCODED_LEN,
25669 __tmp.remaining(),
25670 )
25671 }
25672 __tmp.put_u32_le(self.time_boot_ms);
25673 __tmp.put_i16_le(self.xacc);
25674 __tmp.put_i16_le(self.yacc);
25675 __tmp.put_i16_le(self.zacc);
25676 __tmp.put_i16_le(self.xgyro);
25677 __tmp.put_i16_le(self.ygyro);
25678 __tmp.put_i16_le(self.zgyro);
25679 __tmp.put_i16_le(self.xmag);
25680 __tmp.put_i16_le(self.ymag);
25681 __tmp.put_i16_le(self.zmag);
25682 __tmp.put_i16_le(self.temperature);
25683 if matches!(version, MavlinkVersion::V2) {
25684 let len = __tmp.len();
25685 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25686 } else {
25687 __tmp.len()
25688 }
25689 }
25690}
25691#[doc = "id: 129"]
25692#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
25693#[derive(Debug, Clone, PartialEq)]
25694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25695#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25696pub struct SCALED_IMU3_DATA {
25697 #[doc = "Timestamp (time since system boot)."]
25698 pub time_boot_ms: u32,
25699 #[doc = "X acceleration"]
25700 pub xacc: i16,
25701 #[doc = "Y acceleration"]
25702 pub yacc: i16,
25703 #[doc = "Z acceleration"]
25704 pub zacc: i16,
25705 #[doc = "Angular speed around X axis"]
25706 pub xgyro: i16,
25707 #[doc = "Angular speed around Y axis"]
25708 pub ygyro: i16,
25709 #[doc = "Angular speed around Z axis"]
25710 pub zgyro: i16,
25711 #[doc = "X Magnetic field"]
25712 pub xmag: i16,
25713 #[doc = "Y Magnetic field"]
25714 pub ymag: i16,
25715 #[doc = "Z Magnetic field"]
25716 pub zmag: i16,
25717 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25718 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25719 pub temperature: i16,
25720}
25721impl SCALED_IMU3_DATA {
25722 pub const ENCODED_LEN: usize = 24usize;
25723 pub const DEFAULT: Self = Self {
25724 time_boot_ms: 0_u32,
25725 xacc: 0_i16,
25726 yacc: 0_i16,
25727 zacc: 0_i16,
25728 xgyro: 0_i16,
25729 ygyro: 0_i16,
25730 zgyro: 0_i16,
25731 xmag: 0_i16,
25732 ymag: 0_i16,
25733 zmag: 0_i16,
25734 temperature: 0_i16,
25735 };
25736 #[cfg(feature = "arbitrary")]
25737 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25738 use arbitrary::{Arbitrary, Unstructured};
25739 let mut buf = [0u8; 1024];
25740 rng.fill_bytes(&mut buf);
25741 let mut unstructured = Unstructured::new(&buf);
25742 Self::arbitrary(&mut unstructured).unwrap_or_default()
25743 }
25744}
25745impl Default for SCALED_IMU3_DATA {
25746 fn default() -> Self {
25747 Self::DEFAULT.clone()
25748 }
25749}
25750impl MessageData for SCALED_IMU3_DATA {
25751 type Message = MavMessage;
25752 const ID: u32 = 129u32;
25753 const NAME: &'static str = "SCALED_IMU3";
25754 const EXTRA_CRC: u8 = 46u8;
25755 const ENCODED_LEN: usize = 24usize;
25756 fn deser(
25757 _version: MavlinkVersion,
25758 __input: &[u8],
25759 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25760 let avail_len = __input.len();
25761 let mut payload_buf = [0; Self::ENCODED_LEN];
25762 let mut buf = if avail_len < Self::ENCODED_LEN {
25763 payload_buf[0..avail_len].copy_from_slice(__input);
25764 Bytes::new(&payload_buf)
25765 } else {
25766 Bytes::new(__input)
25767 };
25768 let mut __struct = Self::default();
25769 __struct.time_boot_ms = buf.get_u32_le();
25770 __struct.xacc = buf.get_i16_le();
25771 __struct.yacc = buf.get_i16_le();
25772 __struct.zacc = buf.get_i16_le();
25773 __struct.xgyro = buf.get_i16_le();
25774 __struct.ygyro = buf.get_i16_le();
25775 __struct.zgyro = buf.get_i16_le();
25776 __struct.xmag = buf.get_i16_le();
25777 __struct.ymag = buf.get_i16_le();
25778 __struct.zmag = buf.get_i16_le();
25779 __struct.temperature = buf.get_i16_le();
25780 Ok(__struct)
25781 }
25782 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25783 let mut __tmp = BytesMut::new(bytes);
25784 #[allow(clippy::absurd_extreme_comparisons)]
25785 #[allow(unused_comparisons)]
25786 if __tmp.remaining() < Self::ENCODED_LEN {
25787 panic!(
25788 "buffer is too small (need {} bytes, but got {})",
25789 Self::ENCODED_LEN,
25790 __tmp.remaining(),
25791 )
25792 }
25793 __tmp.put_u32_le(self.time_boot_ms);
25794 __tmp.put_i16_le(self.xacc);
25795 __tmp.put_i16_le(self.yacc);
25796 __tmp.put_i16_le(self.zacc);
25797 __tmp.put_i16_le(self.xgyro);
25798 __tmp.put_i16_le(self.ygyro);
25799 __tmp.put_i16_le(self.zgyro);
25800 __tmp.put_i16_le(self.xmag);
25801 __tmp.put_i16_le(self.ymag);
25802 __tmp.put_i16_le(self.zmag);
25803 __tmp.put_i16_le(self.temperature);
25804 if matches!(version, MavlinkVersion::V2) {
25805 let len = __tmp.len();
25806 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25807 } else {
25808 __tmp.len()
25809 }
25810 }
25811}
25812#[doc = "id: 29"]
25813#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
25814#[derive(Debug, Clone, PartialEq)]
25815#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25817pub struct SCALED_PRESSURE_DATA {
25818 #[doc = "Timestamp (time since system boot)."]
25819 pub time_boot_ms: u32,
25820 #[doc = "Absolute pressure"]
25821 pub press_abs: f32,
25822 #[doc = "Differential pressure 1"]
25823 pub press_diff: f32,
25824 #[doc = "Absolute pressure temperature"]
25825 pub temperature: i16,
25826 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
25827 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25828 pub temperature_press_diff: i16,
25829}
25830impl SCALED_PRESSURE_DATA {
25831 pub const ENCODED_LEN: usize = 16usize;
25832 pub const DEFAULT: Self = Self {
25833 time_boot_ms: 0_u32,
25834 press_abs: 0.0_f32,
25835 press_diff: 0.0_f32,
25836 temperature: 0_i16,
25837 temperature_press_diff: 0_i16,
25838 };
25839 #[cfg(feature = "arbitrary")]
25840 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25841 use arbitrary::{Arbitrary, Unstructured};
25842 let mut buf = [0u8; 1024];
25843 rng.fill_bytes(&mut buf);
25844 let mut unstructured = Unstructured::new(&buf);
25845 Self::arbitrary(&mut unstructured).unwrap_or_default()
25846 }
25847}
25848impl Default for SCALED_PRESSURE_DATA {
25849 fn default() -> Self {
25850 Self::DEFAULT.clone()
25851 }
25852}
25853impl MessageData for SCALED_PRESSURE_DATA {
25854 type Message = MavMessage;
25855 const ID: u32 = 29u32;
25856 const NAME: &'static str = "SCALED_PRESSURE";
25857 const EXTRA_CRC: u8 = 115u8;
25858 const ENCODED_LEN: usize = 16usize;
25859 fn deser(
25860 _version: MavlinkVersion,
25861 __input: &[u8],
25862 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25863 let avail_len = __input.len();
25864 let mut payload_buf = [0; Self::ENCODED_LEN];
25865 let mut buf = if avail_len < Self::ENCODED_LEN {
25866 payload_buf[0..avail_len].copy_from_slice(__input);
25867 Bytes::new(&payload_buf)
25868 } else {
25869 Bytes::new(__input)
25870 };
25871 let mut __struct = Self::default();
25872 __struct.time_boot_ms = buf.get_u32_le();
25873 __struct.press_abs = buf.get_f32_le();
25874 __struct.press_diff = buf.get_f32_le();
25875 __struct.temperature = buf.get_i16_le();
25876 __struct.temperature_press_diff = buf.get_i16_le();
25877 Ok(__struct)
25878 }
25879 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25880 let mut __tmp = BytesMut::new(bytes);
25881 #[allow(clippy::absurd_extreme_comparisons)]
25882 #[allow(unused_comparisons)]
25883 if __tmp.remaining() < Self::ENCODED_LEN {
25884 panic!(
25885 "buffer is too small (need {} bytes, but got {})",
25886 Self::ENCODED_LEN,
25887 __tmp.remaining(),
25888 )
25889 }
25890 __tmp.put_u32_le(self.time_boot_ms);
25891 __tmp.put_f32_le(self.press_abs);
25892 __tmp.put_f32_le(self.press_diff);
25893 __tmp.put_i16_le(self.temperature);
25894 __tmp.put_i16_le(self.temperature_press_diff);
25895 if matches!(version, MavlinkVersion::V2) {
25896 let len = __tmp.len();
25897 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25898 } else {
25899 __tmp.len()
25900 }
25901 }
25902}
25903#[doc = "id: 137"]
25904#[doc = "Barometer readings for 2nd barometer."]
25905#[derive(Debug, Clone, PartialEq)]
25906#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25907#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25908pub struct SCALED_PRESSURE2_DATA {
25909 #[doc = "Timestamp (time since system boot)."]
25910 pub time_boot_ms: u32,
25911 #[doc = "Absolute pressure"]
25912 pub press_abs: f32,
25913 #[doc = "Differential pressure"]
25914 pub press_diff: f32,
25915 #[doc = "Absolute pressure temperature"]
25916 pub temperature: i16,
25917 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
25918 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25919 pub temperature_press_diff: i16,
25920}
25921impl SCALED_PRESSURE2_DATA {
25922 pub const ENCODED_LEN: usize = 16usize;
25923 pub const DEFAULT: Self = Self {
25924 time_boot_ms: 0_u32,
25925 press_abs: 0.0_f32,
25926 press_diff: 0.0_f32,
25927 temperature: 0_i16,
25928 temperature_press_diff: 0_i16,
25929 };
25930 #[cfg(feature = "arbitrary")]
25931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25932 use arbitrary::{Arbitrary, Unstructured};
25933 let mut buf = [0u8; 1024];
25934 rng.fill_bytes(&mut buf);
25935 let mut unstructured = Unstructured::new(&buf);
25936 Self::arbitrary(&mut unstructured).unwrap_or_default()
25937 }
25938}
25939impl Default for SCALED_PRESSURE2_DATA {
25940 fn default() -> Self {
25941 Self::DEFAULT.clone()
25942 }
25943}
25944impl MessageData for SCALED_PRESSURE2_DATA {
25945 type Message = MavMessage;
25946 const ID: u32 = 137u32;
25947 const NAME: &'static str = "SCALED_PRESSURE2";
25948 const EXTRA_CRC: u8 = 195u8;
25949 const ENCODED_LEN: usize = 16usize;
25950 fn deser(
25951 _version: MavlinkVersion,
25952 __input: &[u8],
25953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25954 let avail_len = __input.len();
25955 let mut payload_buf = [0; Self::ENCODED_LEN];
25956 let mut buf = if avail_len < Self::ENCODED_LEN {
25957 payload_buf[0..avail_len].copy_from_slice(__input);
25958 Bytes::new(&payload_buf)
25959 } else {
25960 Bytes::new(__input)
25961 };
25962 let mut __struct = Self::default();
25963 __struct.time_boot_ms = buf.get_u32_le();
25964 __struct.press_abs = buf.get_f32_le();
25965 __struct.press_diff = buf.get_f32_le();
25966 __struct.temperature = buf.get_i16_le();
25967 __struct.temperature_press_diff = buf.get_i16_le();
25968 Ok(__struct)
25969 }
25970 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25971 let mut __tmp = BytesMut::new(bytes);
25972 #[allow(clippy::absurd_extreme_comparisons)]
25973 #[allow(unused_comparisons)]
25974 if __tmp.remaining() < Self::ENCODED_LEN {
25975 panic!(
25976 "buffer is too small (need {} bytes, but got {})",
25977 Self::ENCODED_LEN,
25978 __tmp.remaining(),
25979 )
25980 }
25981 __tmp.put_u32_le(self.time_boot_ms);
25982 __tmp.put_f32_le(self.press_abs);
25983 __tmp.put_f32_le(self.press_diff);
25984 __tmp.put_i16_le(self.temperature);
25985 __tmp.put_i16_le(self.temperature_press_diff);
25986 if matches!(version, MavlinkVersion::V2) {
25987 let len = __tmp.len();
25988 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25989 } else {
25990 __tmp.len()
25991 }
25992 }
25993}
25994#[doc = "id: 143"]
25995#[doc = "Barometer readings for 3rd barometer."]
25996#[derive(Debug, Clone, PartialEq)]
25997#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25998#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25999pub struct SCALED_PRESSURE3_DATA {
26000 #[doc = "Timestamp (time since system boot)."]
26001 pub time_boot_ms: u32,
26002 #[doc = "Absolute pressure"]
26003 pub press_abs: f32,
26004 #[doc = "Differential pressure"]
26005 pub press_diff: f32,
26006 #[doc = "Absolute pressure temperature"]
26007 pub temperature: i16,
26008 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26009 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26010 pub temperature_press_diff: i16,
26011}
26012impl SCALED_PRESSURE3_DATA {
26013 pub const ENCODED_LEN: usize = 16usize;
26014 pub const DEFAULT: Self = Self {
26015 time_boot_ms: 0_u32,
26016 press_abs: 0.0_f32,
26017 press_diff: 0.0_f32,
26018 temperature: 0_i16,
26019 temperature_press_diff: 0_i16,
26020 };
26021 #[cfg(feature = "arbitrary")]
26022 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26023 use arbitrary::{Arbitrary, Unstructured};
26024 let mut buf = [0u8; 1024];
26025 rng.fill_bytes(&mut buf);
26026 let mut unstructured = Unstructured::new(&buf);
26027 Self::arbitrary(&mut unstructured).unwrap_or_default()
26028 }
26029}
26030impl Default for SCALED_PRESSURE3_DATA {
26031 fn default() -> Self {
26032 Self::DEFAULT.clone()
26033 }
26034}
26035impl MessageData for SCALED_PRESSURE3_DATA {
26036 type Message = MavMessage;
26037 const ID: u32 = 143u32;
26038 const NAME: &'static str = "SCALED_PRESSURE3";
26039 const EXTRA_CRC: u8 = 131u8;
26040 const ENCODED_LEN: usize = 16usize;
26041 fn deser(
26042 _version: MavlinkVersion,
26043 __input: &[u8],
26044 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26045 let avail_len = __input.len();
26046 let mut payload_buf = [0; Self::ENCODED_LEN];
26047 let mut buf = if avail_len < Self::ENCODED_LEN {
26048 payload_buf[0..avail_len].copy_from_slice(__input);
26049 Bytes::new(&payload_buf)
26050 } else {
26051 Bytes::new(__input)
26052 };
26053 let mut __struct = Self::default();
26054 __struct.time_boot_ms = buf.get_u32_le();
26055 __struct.press_abs = buf.get_f32_le();
26056 __struct.press_diff = buf.get_f32_le();
26057 __struct.temperature = buf.get_i16_le();
26058 __struct.temperature_press_diff = buf.get_i16_le();
26059 Ok(__struct)
26060 }
26061 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26062 let mut __tmp = BytesMut::new(bytes);
26063 #[allow(clippy::absurd_extreme_comparisons)]
26064 #[allow(unused_comparisons)]
26065 if __tmp.remaining() < Self::ENCODED_LEN {
26066 panic!(
26067 "buffer is too small (need {} bytes, but got {})",
26068 Self::ENCODED_LEN,
26069 __tmp.remaining(),
26070 )
26071 }
26072 __tmp.put_u32_le(self.time_boot_ms);
26073 __tmp.put_f32_le(self.press_abs);
26074 __tmp.put_f32_le(self.press_diff);
26075 __tmp.put_i16_le(self.temperature);
26076 __tmp.put_i16_le(self.temperature_press_diff);
26077 if matches!(version, MavlinkVersion::V2) {
26078 let len = __tmp.len();
26079 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26080 } else {
26081 __tmp.len()
26082 }
26083 }
26084}
26085#[doc = "id: 183"]
26086#[doc = "This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts."]
26087#[derive(Debug, Clone, PartialEq)]
26088#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26089#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26090pub struct SCRIPT_COUNT_DATA {
26091 #[doc = "Number of script items in the sequence"]
26092 pub count: u16,
26093 #[doc = "System ID"]
26094 pub target_system: u8,
26095 #[doc = "Component ID"]
26096 pub target_component: u8,
26097}
26098impl SCRIPT_COUNT_DATA {
26099 pub const ENCODED_LEN: usize = 4usize;
26100 pub const DEFAULT: Self = Self {
26101 count: 0_u16,
26102 target_system: 0_u8,
26103 target_component: 0_u8,
26104 };
26105 #[cfg(feature = "arbitrary")]
26106 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26107 use arbitrary::{Arbitrary, Unstructured};
26108 let mut buf = [0u8; 1024];
26109 rng.fill_bytes(&mut buf);
26110 let mut unstructured = Unstructured::new(&buf);
26111 Self::arbitrary(&mut unstructured).unwrap_or_default()
26112 }
26113}
26114impl Default for SCRIPT_COUNT_DATA {
26115 fn default() -> Self {
26116 Self::DEFAULT.clone()
26117 }
26118}
26119impl MessageData for SCRIPT_COUNT_DATA {
26120 type Message = MavMessage;
26121 const ID: u32 = 183u32;
26122 const NAME: &'static str = "SCRIPT_COUNT";
26123 const EXTRA_CRC: u8 = 186u8;
26124 const ENCODED_LEN: usize = 4usize;
26125 fn deser(
26126 _version: MavlinkVersion,
26127 __input: &[u8],
26128 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26129 let avail_len = __input.len();
26130 let mut payload_buf = [0; Self::ENCODED_LEN];
26131 let mut buf = if avail_len < Self::ENCODED_LEN {
26132 payload_buf[0..avail_len].copy_from_slice(__input);
26133 Bytes::new(&payload_buf)
26134 } else {
26135 Bytes::new(__input)
26136 };
26137 let mut __struct = Self::default();
26138 __struct.count = buf.get_u16_le();
26139 __struct.target_system = buf.get_u8();
26140 __struct.target_component = buf.get_u8();
26141 Ok(__struct)
26142 }
26143 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26144 let mut __tmp = BytesMut::new(bytes);
26145 #[allow(clippy::absurd_extreme_comparisons)]
26146 #[allow(unused_comparisons)]
26147 if __tmp.remaining() < Self::ENCODED_LEN {
26148 panic!(
26149 "buffer is too small (need {} bytes, but got {})",
26150 Self::ENCODED_LEN,
26151 __tmp.remaining(),
26152 )
26153 }
26154 __tmp.put_u16_le(self.count);
26155 __tmp.put_u8(self.target_system);
26156 __tmp.put_u8(self.target_component);
26157 if matches!(version, MavlinkVersion::V2) {
26158 let len = __tmp.len();
26159 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26160 } else {
26161 __tmp.len()
26162 }
26163 }
26164}
26165#[doc = "id: 184"]
26166#[doc = "This message informs about the currently active SCRIPT."]
26167#[derive(Debug, Clone, PartialEq)]
26168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26170pub struct SCRIPT_CURRENT_DATA {
26171 #[doc = "Active Sequence"]
26172 pub seq: u16,
26173}
26174impl SCRIPT_CURRENT_DATA {
26175 pub const ENCODED_LEN: usize = 2usize;
26176 pub const DEFAULT: Self = Self { seq: 0_u16 };
26177 #[cfg(feature = "arbitrary")]
26178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26179 use arbitrary::{Arbitrary, Unstructured};
26180 let mut buf = [0u8; 1024];
26181 rng.fill_bytes(&mut buf);
26182 let mut unstructured = Unstructured::new(&buf);
26183 Self::arbitrary(&mut unstructured).unwrap_or_default()
26184 }
26185}
26186impl Default for SCRIPT_CURRENT_DATA {
26187 fn default() -> Self {
26188 Self::DEFAULT.clone()
26189 }
26190}
26191impl MessageData for SCRIPT_CURRENT_DATA {
26192 type Message = MavMessage;
26193 const ID: u32 = 184u32;
26194 const NAME: &'static str = "SCRIPT_CURRENT";
26195 const EXTRA_CRC: u8 = 40u8;
26196 const ENCODED_LEN: usize = 2usize;
26197 fn deser(
26198 _version: MavlinkVersion,
26199 __input: &[u8],
26200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26201 let avail_len = __input.len();
26202 let mut payload_buf = [0; Self::ENCODED_LEN];
26203 let mut buf = if avail_len < Self::ENCODED_LEN {
26204 payload_buf[0..avail_len].copy_from_slice(__input);
26205 Bytes::new(&payload_buf)
26206 } else {
26207 Bytes::new(__input)
26208 };
26209 let mut __struct = Self::default();
26210 __struct.seq = buf.get_u16_le();
26211 Ok(__struct)
26212 }
26213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26214 let mut __tmp = BytesMut::new(bytes);
26215 #[allow(clippy::absurd_extreme_comparisons)]
26216 #[allow(unused_comparisons)]
26217 if __tmp.remaining() < Self::ENCODED_LEN {
26218 panic!(
26219 "buffer is too small (need {} bytes, but got {})",
26220 Self::ENCODED_LEN,
26221 __tmp.remaining(),
26222 )
26223 }
26224 __tmp.put_u16_le(self.seq);
26225 if matches!(version, MavlinkVersion::V2) {
26226 let len = __tmp.len();
26227 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26228 } else {
26229 __tmp.len()
26230 }
26231 }
26232}
26233#[doc = "id: 180"]
26234#[doc = "Message encoding a mission script item. This message is emitted upon a request for the next script item."]
26235#[derive(Debug, Clone, PartialEq)]
26236#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26237#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26238pub struct SCRIPT_ITEM_DATA {
26239 #[doc = "Sequence"]
26240 pub seq: u16,
26241 #[doc = "System ID"]
26242 pub target_system: u8,
26243 #[doc = "Component ID"]
26244 pub target_component: u8,
26245 #[doc = "The name of the mission script, NULL terminated."]
26246 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26247 pub name: [u8; 50],
26248}
26249impl SCRIPT_ITEM_DATA {
26250 pub const ENCODED_LEN: usize = 54usize;
26251 pub const DEFAULT: Self = Self {
26252 seq: 0_u16,
26253 target_system: 0_u8,
26254 target_component: 0_u8,
26255 name: [0_u8; 50usize],
26256 };
26257 #[cfg(feature = "arbitrary")]
26258 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26259 use arbitrary::{Arbitrary, Unstructured};
26260 let mut buf = [0u8; 1024];
26261 rng.fill_bytes(&mut buf);
26262 let mut unstructured = Unstructured::new(&buf);
26263 Self::arbitrary(&mut unstructured).unwrap_or_default()
26264 }
26265}
26266impl Default for SCRIPT_ITEM_DATA {
26267 fn default() -> Self {
26268 Self::DEFAULT.clone()
26269 }
26270}
26271impl MessageData for SCRIPT_ITEM_DATA {
26272 type Message = MavMessage;
26273 const ID: u32 = 180u32;
26274 const NAME: &'static str = "SCRIPT_ITEM";
26275 const EXTRA_CRC: u8 = 231u8;
26276 const ENCODED_LEN: usize = 54usize;
26277 fn deser(
26278 _version: MavlinkVersion,
26279 __input: &[u8],
26280 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26281 let avail_len = __input.len();
26282 let mut payload_buf = [0; Self::ENCODED_LEN];
26283 let mut buf = if avail_len < Self::ENCODED_LEN {
26284 payload_buf[0..avail_len].copy_from_slice(__input);
26285 Bytes::new(&payload_buf)
26286 } else {
26287 Bytes::new(__input)
26288 };
26289 let mut __struct = Self::default();
26290 __struct.seq = buf.get_u16_le();
26291 __struct.target_system = buf.get_u8();
26292 __struct.target_component = buf.get_u8();
26293 for v in &mut __struct.name {
26294 let val = buf.get_u8();
26295 *v = val;
26296 }
26297 Ok(__struct)
26298 }
26299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26300 let mut __tmp = BytesMut::new(bytes);
26301 #[allow(clippy::absurd_extreme_comparisons)]
26302 #[allow(unused_comparisons)]
26303 if __tmp.remaining() < Self::ENCODED_LEN {
26304 panic!(
26305 "buffer is too small (need {} bytes, but got {})",
26306 Self::ENCODED_LEN,
26307 __tmp.remaining(),
26308 )
26309 }
26310 __tmp.put_u16_le(self.seq);
26311 __tmp.put_u8(self.target_system);
26312 __tmp.put_u8(self.target_component);
26313 for val in &self.name {
26314 __tmp.put_u8(*val);
26315 }
26316 if matches!(version, MavlinkVersion::V2) {
26317 let len = __tmp.len();
26318 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26319 } else {
26320 __tmp.len()
26321 }
26322 }
26323}
26324#[doc = "id: 181"]
26325#[doc = "Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message."]
26326#[derive(Debug, Clone, PartialEq)]
26327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26329pub struct SCRIPT_REQUEST_DATA {
26330 #[doc = "Sequence"]
26331 pub seq: u16,
26332 #[doc = "System ID"]
26333 pub target_system: u8,
26334 #[doc = "Component ID"]
26335 pub target_component: u8,
26336}
26337impl SCRIPT_REQUEST_DATA {
26338 pub const ENCODED_LEN: usize = 4usize;
26339 pub const DEFAULT: Self = Self {
26340 seq: 0_u16,
26341 target_system: 0_u8,
26342 target_component: 0_u8,
26343 };
26344 #[cfg(feature = "arbitrary")]
26345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26346 use arbitrary::{Arbitrary, Unstructured};
26347 let mut buf = [0u8; 1024];
26348 rng.fill_bytes(&mut buf);
26349 let mut unstructured = Unstructured::new(&buf);
26350 Self::arbitrary(&mut unstructured).unwrap_or_default()
26351 }
26352}
26353impl Default for SCRIPT_REQUEST_DATA {
26354 fn default() -> Self {
26355 Self::DEFAULT.clone()
26356 }
26357}
26358impl MessageData for SCRIPT_REQUEST_DATA {
26359 type Message = MavMessage;
26360 const ID: u32 = 181u32;
26361 const NAME: &'static str = "SCRIPT_REQUEST";
26362 const EXTRA_CRC: u8 = 129u8;
26363 const ENCODED_LEN: usize = 4usize;
26364 fn deser(
26365 _version: MavlinkVersion,
26366 __input: &[u8],
26367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26368 let avail_len = __input.len();
26369 let mut payload_buf = [0; Self::ENCODED_LEN];
26370 let mut buf = if avail_len < Self::ENCODED_LEN {
26371 payload_buf[0..avail_len].copy_from_slice(__input);
26372 Bytes::new(&payload_buf)
26373 } else {
26374 Bytes::new(__input)
26375 };
26376 let mut __struct = Self::default();
26377 __struct.seq = buf.get_u16_le();
26378 __struct.target_system = buf.get_u8();
26379 __struct.target_component = buf.get_u8();
26380 Ok(__struct)
26381 }
26382 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26383 let mut __tmp = BytesMut::new(bytes);
26384 #[allow(clippy::absurd_extreme_comparisons)]
26385 #[allow(unused_comparisons)]
26386 if __tmp.remaining() < Self::ENCODED_LEN {
26387 panic!(
26388 "buffer is too small (need {} bytes, but got {})",
26389 Self::ENCODED_LEN,
26390 __tmp.remaining(),
26391 )
26392 }
26393 __tmp.put_u16_le(self.seq);
26394 __tmp.put_u8(self.target_system);
26395 __tmp.put_u8(self.target_component);
26396 if matches!(version, MavlinkVersion::V2) {
26397 let len = __tmp.len();
26398 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26399 } else {
26400 __tmp.len()
26401 }
26402 }
26403}
26404#[doc = "id: 182"]
26405#[doc = "Request the overall list of mission items from the system/component."]
26406#[derive(Debug, Clone, PartialEq)]
26407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26409pub struct SCRIPT_REQUEST_LIST_DATA {
26410 #[doc = "System ID"]
26411 pub target_system: u8,
26412 #[doc = "Component ID"]
26413 pub target_component: u8,
26414}
26415impl SCRIPT_REQUEST_LIST_DATA {
26416 pub const ENCODED_LEN: usize = 2usize;
26417 pub const DEFAULT: Self = Self {
26418 target_system: 0_u8,
26419 target_component: 0_u8,
26420 };
26421 #[cfg(feature = "arbitrary")]
26422 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26423 use arbitrary::{Arbitrary, Unstructured};
26424 let mut buf = [0u8; 1024];
26425 rng.fill_bytes(&mut buf);
26426 let mut unstructured = Unstructured::new(&buf);
26427 Self::arbitrary(&mut unstructured).unwrap_or_default()
26428 }
26429}
26430impl Default for SCRIPT_REQUEST_LIST_DATA {
26431 fn default() -> Self {
26432 Self::DEFAULT.clone()
26433 }
26434}
26435impl MessageData for SCRIPT_REQUEST_LIST_DATA {
26436 type Message = MavMessage;
26437 const ID: u32 = 182u32;
26438 const NAME: &'static str = "SCRIPT_REQUEST_LIST";
26439 const EXTRA_CRC: u8 = 115u8;
26440 const ENCODED_LEN: usize = 2usize;
26441 fn deser(
26442 _version: MavlinkVersion,
26443 __input: &[u8],
26444 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26445 let avail_len = __input.len();
26446 let mut payload_buf = [0; Self::ENCODED_LEN];
26447 let mut buf = if avail_len < Self::ENCODED_LEN {
26448 payload_buf[0..avail_len].copy_from_slice(__input);
26449 Bytes::new(&payload_buf)
26450 } else {
26451 Bytes::new(__input)
26452 };
26453 let mut __struct = Self::default();
26454 __struct.target_system = buf.get_u8();
26455 __struct.target_component = buf.get_u8();
26456 Ok(__struct)
26457 }
26458 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26459 let mut __tmp = BytesMut::new(bytes);
26460 #[allow(clippy::absurd_extreme_comparisons)]
26461 #[allow(unused_comparisons)]
26462 if __tmp.remaining() < Self::ENCODED_LEN {
26463 panic!(
26464 "buffer is too small (need {} bytes, but got {})",
26465 Self::ENCODED_LEN,
26466 __tmp.remaining(),
26467 )
26468 }
26469 __tmp.put_u8(self.target_system);
26470 __tmp.put_u8(self.target_component);
26471 if matches!(version, MavlinkVersion::V2) {
26472 let len = __tmp.len();
26473 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26474 } else {
26475 __tmp.len()
26476 }
26477 }
26478}
26479#[doc = "id: 126"]
26480#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
26481#[derive(Debug, Clone, PartialEq)]
26482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26484pub struct SERIAL_CONTROL_DATA {
26485 #[doc = "Baudrate of transfer. Zero means no change."]
26486 pub baudrate: u32,
26487 #[doc = "Timeout for reply data"]
26488 pub timeout: u16,
26489 #[doc = "Serial control device type."]
26490 pub device: SerialControlDev,
26491 #[doc = "Bitmap of serial control flags."]
26492 pub flags: SerialControlFlag,
26493 #[doc = "how many bytes in this transfer"]
26494 pub count: u8,
26495 #[doc = "serial data"]
26496 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26497 pub data: [u8; 70],
26498 #[doc = "System ID"]
26499 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26500 pub target_system: u8,
26501 #[doc = "Component ID"]
26502 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26503 pub target_component: u8,
26504}
26505impl SERIAL_CONTROL_DATA {
26506 pub const ENCODED_LEN: usize = 81usize;
26507 pub const DEFAULT: Self = Self {
26508 baudrate: 0_u32,
26509 timeout: 0_u16,
26510 device: SerialControlDev::DEFAULT,
26511 flags: SerialControlFlag::DEFAULT,
26512 count: 0_u8,
26513 data: [0_u8; 70usize],
26514 target_system: 0_u8,
26515 target_component: 0_u8,
26516 };
26517 #[cfg(feature = "arbitrary")]
26518 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26519 use arbitrary::{Arbitrary, Unstructured};
26520 let mut buf = [0u8; 1024];
26521 rng.fill_bytes(&mut buf);
26522 let mut unstructured = Unstructured::new(&buf);
26523 Self::arbitrary(&mut unstructured).unwrap_or_default()
26524 }
26525}
26526impl Default for SERIAL_CONTROL_DATA {
26527 fn default() -> Self {
26528 Self::DEFAULT.clone()
26529 }
26530}
26531impl MessageData for SERIAL_CONTROL_DATA {
26532 type Message = MavMessage;
26533 const ID: u32 = 126u32;
26534 const NAME: &'static str = "SERIAL_CONTROL";
26535 const EXTRA_CRC: u8 = 220u8;
26536 const ENCODED_LEN: usize = 81usize;
26537 fn deser(
26538 _version: MavlinkVersion,
26539 __input: &[u8],
26540 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26541 let avail_len = __input.len();
26542 let mut payload_buf = [0; Self::ENCODED_LEN];
26543 let mut buf = if avail_len < Self::ENCODED_LEN {
26544 payload_buf[0..avail_len].copy_from_slice(__input);
26545 Bytes::new(&payload_buf)
26546 } else {
26547 Bytes::new(__input)
26548 };
26549 let mut __struct = Self::default();
26550 __struct.baudrate = buf.get_u32_le();
26551 __struct.timeout = buf.get_u16_le();
26552 let tmp = buf.get_u8();
26553 __struct.device =
26554 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26555 enum_type: "SerialControlDev",
26556 value: tmp as u32,
26557 })?;
26558 let tmp = buf.get_u8();
26559 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
26560 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26561 flag_type: "SerialControlFlag",
26562 value: tmp as u32,
26563 })?;
26564 __struct.count = buf.get_u8();
26565 for v in &mut __struct.data {
26566 let val = buf.get_u8();
26567 *v = val;
26568 }
26569 __struct.target_system = buf.get_u8();
26570 __struct.target_component = buf.get_u8();
26571 Ok(__struct)
26572 }
26573 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26574 let mut __tmp = BytesMut::new(bytes);
26575 #[allow(clippy::absurd_extreme_comparisons)]
26576 #[allow(unused_comparisons)]
26577 if __tmp.remaining() < Self::ENCODED_LEN {
26578 panic!(
26579 "buffer is too small (need {} bytes, but got {})",
26580 Self::ENCODED_LEN,
26581 __tmp.remaining(),
26582 )
26583 }
26584 __tmp.put_u32_le(self.baudrate);
26585 __tmp.put_u16_le(self.timeout);
26586 __tmp.put_u8(self.device as u8);
26587 __tmp.put_u8(self.flags.bits());
26588 __tmp.put_u8(self.count);
26589 for val in &self.data {
26590 __tmp.put_u8(*val);
26591 }
26592 __tmp.put_u8(self.target_system);
26593 __tmp.put_u8(self.target_component);
26594 if matches!(version, MavlinkVersion::V2) {
26595 let len = __tmp.len();
26596 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26597 } else {
26598 __tmp.len()
26599 }
26600 }
26601}
26602#[doc = "id: 36"]
26603#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
26604#[derive(Debug, Clone, PartialEq)]
26605#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26606#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26607pub struct SERVO_OUTPUT_RAW_DATA {
26608 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26609 pub time_usec: u32,
26610 #[doc = "Servo output 1 value"]
26611 pub servo1_raw: u16,
26612 #[doc = "Servo output 2 value"]
26613 pub servo2_raw: u16,
26614 #[doc = "Servo output 3 value"]
26615 pub servo3_raw: u16,
26616 #[doc = "Servo output 4 value"]
26617 pub servo4_raw: u16,
26618 #[doc = "Servo output 5 value"]
26619 pub servo5_raw: u16,
26620 #[doc = "Servo output 6 value"]
26621 pub servo6_raw: u16,
26622 #[doc = "Servo output 7 value"]
26623 pub servo7_raw: u16,
26624 #[doc = "Servo output 8 value"]
26625 pub servo8_raw: u16,
26626 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26627 pub port: u8,
26628 #[doc = "Servo output 9 value"]
26629 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26630 pub servo9_raw: u16,
26631 #[doc = "Servo output 10 value"]
26632 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26633 pub servo10_raw: u16,
26634 #[doc = "Servo output 11 value"]
26635 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26636 pub servo11_raw: u16,
26637 #[doc = "Servo output 12 value"]
26638 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26639 pub servo12_raw: u16,
26640 #[doc = "Servo output 13 value"]
26641 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26642 pub servo13_raw: u16,
26643 #[doc = "Servo output 14 value"]
26644 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26645 pub servo14_raw: u16,
26646 #[doc = "Servo output 15 value"]
26647 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26648 pub servo15_raw: u16,
26649 #[doc = "Servo output 16 value"]
26650 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26651 pub servo16_raw: u16,
26652}
26653impl SERVO_OUTPUT_RAW_DATA {
26654 pub const ENCODED_LEN: usize = 37usize;
26655 pub const DEFAULT: Self = Self {
26656 time_usec: 0_u32,
26657 servo1_raw: 0_u16,
26658 servo2_raw: 0_u16,
26659 servo3_raw: 0_u16,
26660 servo4_raw: 0_u16,
26661 servo5_raw: 0_u16,
26662 servo6_raw: 0_u16,
26663 servo7_raw: 0_u16,
26664 servo8_raw: 0_u16,
26665 port: 0_u8,
26666 servo9_raw: 0_u16,
26667 servo10_raw: 0_u16,
26668 servo11_raw: 0_u16,
26669 servo12_raw: 0_u16,
26670 servo13_raw: 0_u16,
26671 servo14_raw: 0_u16,
26672 servo15_raw: 0_u16,
26673 servo16_raw: 0_u16,
26674 };
26675 #[cfg(feature = "arbitrary")]
26676 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26677 use arbitrary::{Arbitrary, Unstructured};
26678 let mut buf = [0u8; 1024];
26679 rng.fill_bytes(&mut buf);
26680 let mut unstructured = Unstructured::new(&buf);
26681 Self::arbitrary(&mut unstructured).unwrap_or_default()
26682 }
26683}
26684impl Default for SERVO_OUTPUT_RAW_DATA {
26685 fn default() -> Self {
26686 Self::DEFAULT.clone()
26687 }
26688}
26689impl MessageData for SERVO_OUTPUT_RAW_DATA {
26690 type Message = MavMessage;
26691 const ID: u32 = 36u32;
26692 const NAME: &'static str = "SERVO_OUTPUT_RAW";
26693 const EXTRA_CRC: u8 = 222u8;
26694 const ENCODED_LEN: usize = 37usize;
26695 fn deser(
26696 _version: MavlinkVersion,
26697 __input: &[u8],
26698 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26699 let avail_len = __input.len();
26700 let mut payload_buf = [0; Self::ENCODED_LEN];
26701 let mut buf = if avail_len < Self::ENCODED_LEN {
26702 payload_buf[0..avail_len].copy_from_slice(__input);
26703 Bytes::new(&payload_buf)
26704 } else {
26705 Bytes::new(__input)
26706 };
26707 let mut __struct = Self::default();
26708 __struct.time_usec = buf.get_u32_le();
26709 __struct.servo1_raw = buf.get_u16_le();
26710 __struct.servo2_raw = buf.get_u16_le();
26711 __struct.servo3_raw = buf.get_u16_le();
26712 __struct.servo4_raw = buf.get_u16_le();
26713 __struct.servo5_raw = buf.get_u16_le();
26714 __struct.servo6_raw = buf.get_u16_le();
26715 __struct.servo7_raw = buf.get_u16_le();
26716 __struct.servo8_raw = buf.get_u16_le();
26717 __struct.port = buf.get_u8();
26718 __struct.servo9_raw = buf.get_u16_le();
26719 __struct.servo10_raw = buf.get_u16_le();
26720 __struct.servo11_raw = buf.get_u16_le();
26721 __struct.servo12_raw = buf.get_u16_le();
26722 __struct.servo13_raw = buf.get_u16_le();
26723 __struct.servo14_raw = buf.get_u16_le();
26724 __struct.servo15_raw = buf.get_u16_le();
26725 __struct.servo16_raw = buf.get_u16_le();
26726 Ok(__struct)
26727 }
26728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26729 let mut __tmp = BytesMut::new(bytes);
26730 #[allow(clippy::absurd_extreme_comparisons)]
26731 #[allow(unused_comparisons)]
26732 if __tmp.remaining() < Self::ENCODED_LEN {
26733 panic!(
26734 "buffer is too small (need {} bytes, but got {})",
26735 Self::ENCODED_LEN,
26736 __tmp.remaining(),
26737 )
26738 }
26739 __tmp.put_u32_le(self.time_usec);
26740 __tmp.put_u16_le(self.servo1_raw);
26741 __tmp.put_u16_le(self.servo2_raw);
26742 __tmp.put_u16_le(self.servo3_raw);
26743 __tmp.put_u16_le(self.servo4_raw);
26744 __tmp.put_u16_le(self.servo5_raw);
26745 __tmp.put_u16_le(self.servo6_raw);
26746 __tmp.put_u16_le(self.servo7_raw);
26747 __tmp.put_u16_le(self.servo8_raw);
26748 __tmp.put_u8(self.port);
26749 __tmp.put_u16_le(self.servo9_raw);
26750 __tmp.put_u16_le(self.servo10_raw);
26751 __tmp.put_u16_le(self.servo11_raw);
26752 __tmp.put_u16_le(self.servo12_raw);
26753 __tmp.put_u16_le(self.servo13_raw);
26754 __tmp.put_u16_le(self.servo14_raw);
26755 __tmp.put_u16_le(self.servo15_raw);
26756 __tmp.put_u16_le(self.servo16_raw);
26757 if matches!(version, MavlinkVersion::V2) {
26758 let len = __tmp.len();
26759 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26760 } else {
26761 __tmp.len()
26762 }
26763 }
26764}
26765#[doc = "id: 256"]
26766#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
26767#[derive(Debug, Clone, PartialEq)]
26768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26769#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26770pub struct SETUP_SIGNING_DATA {
26771 #[doc = "initial timestamp"]
26772 pub initial_timestamp: u64,
26773 #[doc = "system id of the target"]
26774 pub target_system: u8,
26775 #[doc = "component ID of the target"]
26776 pub target_component: u8,
26777 #[doc = "signing key"]
26778 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26779 pub secret_key: [u8; 32],
26780}
26781impl SETUP_SIGNING_DATA {
26782 pub const ENCODED_LEN: usize = 42usize;
26783 pub const DEFAULT: Self = Self {
26784 initial_timestamp: 0_u64,
26785 target_system: 0_u8,
26786 target_component: 0_u8,
26787 secret_key: [0_u8; 32usize],
26788 };
26789 #[cfg(feature = "arbitrary")]
26790 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26791 use arbitrary::{Arbitrary, Unstructured};
26792 let mut buf = [0u8; 1024];
26793 rng.fill_bytes(&mut buf);
26794 let mut unstructured = Unstructured::new(&buf);
26795 Self::arbitrary(&mut unstructured).unwrap_or_default()
26796 }
26797}
26798impl Default for SETUP_SIGNING_DATA {
26799 fn default() -> Self {
26800 Self::DEFAULT.clone()
26801 }
26802}
26803impl MessageData for SETUP_SIGNING_DATA {
26804 type Message = MavMessage;
26805 const ID: u32 = 256u32;
26806 const NAME: &'static str = "SETUP_SIGNING";
26807 const EXTRA_CRC: u8 = 71u8;
26808 const ENCODED_LEN: usize = 42usize;
26809 fn deser(
26810 _version: MavlinkVersion,
26811 __input: &[u8],
26812 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26813 let avail_len = __input.len();
26814 let mut payload_buf = [0; Self::ENCODED_LEN];
26815 let mut buf = if avail_len < Self::ENCODED_LEN {
26816 payload_buf[0..avail_len].copy_from_slice(__input);
26817 Bytes::new(&payload_buf)
26818 } else {
26819 Bytes::new(__input)
26820 };
26821 let mut __struct = Self::default();
26822 __struct.initial_timestamp = buf.get_u64_le();
26823 __struct.target_system = buf.get_u8();
26824 __struct.target_component = buf.get_u8();
26825 for v in &mut __struct.secret_key {
26826 let val = buf.get_u8();
26827 *v = val;
26828 }
26829 Ok(__struct)
26830 }
26831 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26832 let mut __tmp = BytesMut::new(bytes);
26833 #[allow(clippy::absurd_extreme_comparisons)]
26834 #[allow(unused_comparisons)]
26835 if __tmp.remaining() < Self::ENCODED_LEN {
26836 panic!(
26837 "buffer is too small (need {} bytes, but got {})",
26838 Self::ENCODED_LEN,
26839 __tmp.remaining(),
26840 )
26841 }
26842 __tmp.put_u64_le(self.initial_timestamp);
26843 __tmp.put_u8(self.target_system);
26844 __tmp.put_u8(self.target_component);
26845 for val in &self.secret_key {
26846 __tmp.put_u8(*val);
26847 }
26848 if matches!(version, MavlinkVersion::V2) {
26849 let len = __tmp.len();
26850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26851 } else {
26852 __tmp.len()
26853 }
26854 }
26855}
26856#[doc = "id: 139"]
26857#[doc = "Set the vehicle attitude and body angular rates."]
26858#[derive(Debug, Clone, PartialEq)]
26859#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26860#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26861pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
26862 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26863 pub time_usec: u64,
26864 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
26865 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26866 pub controls: [f32; 8],
26867 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
26868 pub group_mlx: u8,
26869 #[doc = "System ID"]
26870 pub target_system: u8,
26871 #[doc = "Component ID"]
26872 pub target_component: u8,
26873}
26874impl SET_ACTUATOR_CONTROL_TARGET_DATA {
26875 pub const ENCODED_LEN: usize = 43usize;
26876 pub const DEFAULT: Self = Self {
26877 time_usec: 0_u64,
26878 controls: [0.0_f32; 8usize],
26879 group_mlx: 0_u8,
26880 target_system: 0_u8,
26881 target_component: 0_u8,
26882 };
26883 #[cfg(feature = "arbitrary")]
26884 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26885 use arbitrary::{Arbitrary, Unstructured};
26886 let mut buf = [0u8; 1024];
26887 rng.fill_bytes(&mut buf);
26888 let mut unstructured = Unstructured::new(&buf);
26889 Self::arbitrary(&mut unstructured).unwrap_or_default()
26890 }
26891}
26892impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
26893 fn default() -> Self {
26894 Self::DEFAULT.clone()
26895 }
26896}
26897impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
26898 type Message = MavMessage;
26899 const ID: u32 = 139u32;
26900 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
26901 const EXTRA_CRC: u8 = 168u8;
26902 const ENCODED_LEN: usize = 43usize;
26903 fn deser(
26904 _version: MavlinkVersion,
26905 __input: &[u8],
26906 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26907 let avail_len = __input.len();
26908 let mut payload_buf = [0; Self::ENCODED_LEN];
26909 let mut buf = if avail_len < Self::ENCODED_LEN {
26910 payload_buf[0..avail_len].copy_from_slice(__input);
26911 Bytes::new(&payload_buf)
26912 } else {
26913 Bytes::new(__input)
26914 };
26915 let mut __struct = Self::default();
26916 __struct.time_usec = buf.get_u64_le();
26917 for v in &mut __struct.controls {
26918 let val = buf.get_f32_le();
26919 *v = val;
26920 }
26921 __struct.group_mlx = buf.get_u8();
26922 __struct.target_system = buf.get_u8();
26923 __struct.target_component = buf.get_u8();
26924 Ok(__struct)
26925 }
26926 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26927 let mut __tmp = BytesMut::new(bytes);
26928 #[allow(clippy::absurd_extreme_comparisons)]
26929 #[allow(unused_comparisons)]
26930 if __tmp.remaining() < Self::ENCODED_LEN {
26931 panic!(
26932 "buffer is too small (need {} bytes, but got {})",
26933 Self::ENCODED_LEN,
26934 __tmp.remaining(),
26935 )
26936 }
26937 __tmp.put_u64_le(self.time_usec);
26938 for val in &self.controls {
26939 __tmp.put_f32_le(*val);
26940 }
26941 __tmp.put_u8(self.group_mlx);
26942 __tmp.put_u8(self.target_system);
26943 __tmp.put_u8(self.target_component);
26944 if matches!(version, MavlinkVersion::V2) {
26945 let len = __tmp.len();
26946 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26947 } else {
26948 __tmp.len()
26949 }
26950 }
26951}
26952#[doc = "id: 82"]
26953#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
26954#[derive(Debug, Clone, PartialEq)]
26955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26957pub struct SET_ATTITUDE_TARGET_DATA {
26958 #[doc = "Timestamp (time since system boot)."]
26959 pub time_boot_ms: u32,
26960 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
26961 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26962 pub q: [f32; 4],
26963 #[doc = "Body roll rate"]
26964 pub body_roll_rate: f32,
26965 #[doc = "Body pitch rate"]
26966 pub body_pitch_rate: f32,
26967 #[doc = "Body yaw rate"]
26968 pub body_yaw_rate: f32,
26969 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
26970 pub thrust: f32,
26971 #[doc = "System ID"]
26972 pub target_system: u8,
26973 #[doc = "Component ID"]
26974 pub target_component: u8,
26975 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
26976 pub type_mask: AttitudeTargetTypemask,
26977 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
26978 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26979 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26980 pub thrust_body: [f32; 3],
26981}
26982impl SET_ATTITUDE_TARGET_DATA {
26983 pub const ENCODED_LEN: usize = 51usize;
26984 pub const DEFAULT: Self = Self {
26985 time_boot_ms: 0_u32,
26986 q: [0.0_f32; 4usize],
26987 body_roll_rate: 0.0_f32,
26988 body_pitch_rate: 0.0_f32,
26989 body_yaw_rate: 0.0_f32,
26990 thrust: 0.0_f32,
26991 target_system: 0_u8,
26992 target_component: 0_u8,
26993 type_mask: AttitudeTargetTypemask::DEFAULT,
26994 thrust_body: [0.0_f32; 3usize],
26995 };
26996 #[cfg(feature = "arbitrary")]
26997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26998 use arbitrary::{Arbitrary, Unstructured};
26999 let mut buf = [0u8; 1024];
27000 rng.fill_bytes(&mut buf);
27001 let mut unstructured = Unstructured::new(&buf);
27002 Self::arbitrary(&mut unstructured).unwrap_or_default()
27003 }
27004}
27005impl Default for SET_ATTITUDE_TARGET_DATA {
27006 fn default() -> Self {
27007 Self::DEFAULT.clone()
27008 }
27009}
27010impl MessageData for SET_ATTITUDE_TARGET_DATA {
27011 type Message = MavMessage;
27012 const ID: u32 = 82u32;
27013 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27014 const EXTRA_CRC: u8 = 49u8;
27015 const ENCODED_LEN: usize = 51usize;
27016 fn deser(
27017 _version: MavlinkVersion,
27018 __input: &[u8],
27019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27020 let avail_len = __input.len();
27021 let mut payload_buf = [0; Self::ENCODED_LEN];
27022 let mut buf = if avail_len < Self::ENCODED_LEN {
27023 payload_buf[0..avail_len].copy_from_slice(__input);
27024 Bytes::new(&payload_buf)
27025 } else {
27026 Bytes::new(__input)
27027 };
27028 let mut __struct = Self::default();
27029 __struct.time_boot_ms = buf.get_u32_le();
27030 for v in &mut __struct.q {
27031 let val = buf.get_f32_le();
27032 *v = val;
27033 }
27034 __struct.body_roll_rate = buf.get_f32_le();
27035 __struct.body_pitch_rate = buf.get_f32_le();
27036 __struct.body_yaw_rate = buf.get_f32_le();
27037 __struct.thrust = buf.get_f32_le();
27038 __struct.target_system = buf.get_u8();
27039 __struct.target_component = buf.get_u8();
27040 let tmp = buf.get_u8();
27041 __struct.type_mask = AttitudeTargetTypemask::from_bits(
27042 tmp & AttitudeTargetTypemask::all().bits(),
27043 )
27044 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27045 flag_type: "AttitudeTargetTypemask",
27046 value: tmp as u32,
27047 })?;
27048 for v in &mut __struct.thrust_body {
27049 let val = buf.get_f32_le();
27050 *v = val;
27051 }
27052 Ok(__struct)
27053 }
27054 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27055 let mut __tmp = BytesMut::new(bytes);
27056 #[allow(clippy::absurd_extreme_comparisons)]
27057 #[allow(unused_comparisons)]
27058 if __tmp.remaining() < Self::ENCODED_LEN {
27059 panic!(
27060 "buffer is too small (need {} bytes, but got {})",
27061 Self::ENCODED_LEN,
27062 __tmp.remaining(),
27063 )
27064 }
27065 __tmp.put_u32_le(self.time_boot_ms);
27066 for val in &self.q {
27067 __tmp.put_f32_le(*val);
27068 }
27069 __tmp.put_f32_le(self.body_roll_rate);
27070 __tmp.put_f32_le(self.body_pitch_rate);
27071 __tmp.put_f32_le(self.body_yaw_rate);
27072 __tmp.put_f32_le(self.thrust);
27073 __tmp.put_u8(self.target_system);
27074 __tmp.put_u8(self.target_component);
27075 __tmp.put_u8(self.type_mask.bits());
27076 for val in &self.thrust_body {
27077 __tmp.put_f32_le(*val);
27078 }
27079 if matches!(version, MavlinkVersion::V2) {
27080 let len = __tmp.len();
27081 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27082 } else {
27083 __tmp.len()
27084 }
27085 }
27086}
27087#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27088#[doc = "id: 48"]
27089#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27090#[derive(Debug, Clone, PartialEq)]
27091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27093pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27094 #[doc = "Latitude (WGS84)"]
27095 pub latitude: i32,
27096 #[doc = "Longitude (WGS84)"]
27097 pub longitude: i32,
27098 #[doc = "Altitude (MSL). Positive for up."]
27099 pub altitude: i32,
27100 #[doc = "System ID"]
27101 pub target_system: u8,
27102 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27103 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27104 pub time_usec: u64,
27105}
27106impl SET_GPS_GLOBAL_ORIGIN_DATA {
27107 pub const ENCODED_LEN: usize = 21usize;
27108 pub const DEFAULT: Self = Self {
27109 latitude: 0_i32,
27110 longitude: 0_i32,
27111 altitude: 0_i32,
27112 target_system: 0_u8,
27113 time_usec: 0_u64,
27114 };
27115 #[cfg(feature = "arbitrary")]
27116 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27117 use arbitrary::{Arbitrary, Unstructured};
27118 let mut buf = [0u8; 1024];
27119 rng.fill_bytes(&mut buf);
27120 let mut unstructured = Unstructured::new(&buf);
27121 Self::arbitrary(&mut unstructured).unwrap_or_default()
27122 }
27123}
27124impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27125 fn default() -> Self {
27126 Self::DEFAULT.clone()
27127 }
27128}
27129impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27130 type Message = MavMessage;
27131 const ID: u32 = 48u32;
27132 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27133 const EXTRA_CRC: u8 = 41u8;
27134 const ENCODED_LEN: usize = 21usize;
27135 fn deser(
27136 _version: MavlinkVersion,
27137 __input: &[u8],
27138 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27139 let avail_len = __input.len();
27140 let mut payload_buf = [0; Self::ENCODED_LEN];
27141 let mut buf = if avail_len < Self::ENCODED_LEN {
27142 payload_buf[0..avail_len].copy_from_slice(__input);
27143 Bytes::new(&payload_buf)
27144 } else {
27145 Bytes::new(__input)
27146 };
27147 let mut __struct = Self::default();
27148 __struct.latitude = buf.get_i32_le();
27149 __struct.longitude = buf.get_i32_le();
27150 __struct.altitude = buf.get_i32_le();
27151 __struct.target_system = buf.get_u8();
27152 __struct.time_usec = buf.get_u64_le();
27153 Ok(__struct)
27154 }
27155 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27156 let mut __tmp = BytesMut::new(bytes);
27157 #[allow(clippy::absurd_extreme_comparisons)]
27158 #[allow(unused_comparisons)]
27159 if __tmp.remaining() < Self::ENCODED_LEN {
27160 panic!(
27161 "buffer is too small (need {} bytes, but got {})",
27162 Self::ENCODED_LEN,
27163 __tmp.remaining(),
27164 )
27165 }
27166 __tmp.put_i32_le(self.latitude);
27167 __tmp.put_i32_le(self.longitude);
27168 __tmp.put_i32_le(self.altitude);
27169 __tmp.put_u8(self.target_system);
27170 __tmp.put_u64_le(self.time_usec);
27171 if matches!(version, MavlinkVersion::V2) {
27172 let len = __tmp.len();
27173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27174 } else {
27175 __tmp.len()
27176 }
27177 }
27178}
27179#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27180#[doc = "id: 243"]
27181#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27182#[derive(Debug, Clone, PartialEq)]
27183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27185pub struct SET_HOME_POSITION_DATA {
27186 #[doc = "Latitude (WGS84)"]
27187 pub latitude: i32,
27188 #[doc = "Longitude (WGS84)"]
27189 pub longitude: i32,
27190 #[doc = "Altitude (MSL). Positive for up."]
27191 pub altitude: i32,
27192 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27193 pub x: f32,
27194 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27195 pub y: f32,
27196 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27197 pub z: f32,
27198 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27199 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27200 pub q: [f32; 4],
27201 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27202 pub approach_x: f32,
27203 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27204 pub approach_y: f32,
27205 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27206 pub approach_z: f32,
27207 #[doc = "System ID."]
27208 pub target_system: u8,
27209 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27210 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27211 pub time_usec: u64,
27212}
27213impl SET_HOME_POSITION_DATA {
27214 pub const ENCODED_LEN: usize = 61usize;
27215 pub const DEFAULT: Self = Self {
27216 latitude: 0_i32,
27217 longitude: 0_i32,
27218 altitude: 0_i32,
27219 x: 0.0_f32,
27220 y: 0.0_f32,
27221 z: 0.0_f32,
27222 q: [0.0_f32; 4usize],
27223 approach_x: 0.0_f32,
27224 approach_y: 0.0_f32,
27225 approach_z: 0.0_f32,
27226 target_system: 0_u8,
27227 time_usec: 0_u64,
27228 };
27229 #[cfg(feature = "arbitrary")]
27230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27231 use arbitrary::{Arbitrary, Unstructured};
27232 let mut buf = [0u8; 1024];
27233 rng.fill_bytes(&mut buf);
27234 let mut unstructured = Unstructured::new(&buf);
27235 Self::arbitrary(&mut unstructured).unwrap_or_default()
27236 }
27237}
27238impl Default for SET_HOME_POSITION_DATA {
27239 fn default() -> Self {
27240 Self::DEFAULT.clone()
27241 }
27242}
27243impl MessageData for SET_HOME_POSITION_DATA {
27244 type Message = MavMessage;
27245 const ID: u32 = 243u32;
27246 const NAME: &'static str = "SET_HOME_POSITION";
27247 const EXTRA_CRC: u8 = 85u8;
27248 const ENCODED_LEN: usize = 61usize;
27249 fn deser(
27250 _version: MavlinkVersion,
27251 __input: &[u8],
27252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27253 let avail_len = __input.len();
27254 let mut payload_buf = [0; Self::ENCODED_LEN];
27255 let mut buf = if avail_len < Self::ENCODED_LEN {
27256 payload_buf[0..avail_len].copy_from_slice(__input);
27257 Bytes::new(&payload_buf)
27258 } else {
27259 Bytes::new(__input)
27260 };
27261 let mut __struct = Self::default();
27262 __struct.latitude = buf.get_i32_le();
27263 __struct.longitude = buf.get_i32_le();
27264 __struct.altitude = buf.get_i32_le();
27265 __struct.x = buf.get_f32_le();
27266 __struct.y = buf.get_f32_le();
27267 __struct.z = buf.get_f32_le();
27268 for v in &mut __struct.q {
27269 let val = buf.get_f32_le();
27270 *v = val;
27271 }
27272 __struct.approach_x = buf.get_f32_le();
27273 __struct.approach_y = buf.get_f32_le();
27274 __struct.approach_z = buf.get_f32_le();
27275 __struct.target_system = buf.get_u8();
27276 __struct.time_usec = buf.get_u64_le();
27277 Ok(__struct)
27278 }
27279 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27280 let mut __tmp = BytesMut::new(bytes);
27281 #[allow(clippy::absurd_extreme_comparisons)]
27282 #[allow(unused_comparisons)]
27283 if __tmp.remaining() < Self::ENCODED_LEN {
27284 panic!(
27285 "buffer is too small (need {} bytes, but got {})",
27286 Self::ENCODED_LEN,
27287 __tmp.remaining(),
27288 )
27289 }
27290 __tmp.put_i32_le(self.latitude);
27291 __tmp.put_i32_le(self.longitude);
27292 __tmp.put_i32_le(self.altitude);
27293 __tmp.put_f32_le(self.x);
27294 __tmp.put_f32_le(self.y);
27295 __tmp.put_f32_le(self.z);
27296 for val in &self.q {
27297 __tmp.put_f32_le(*val);
27298 }
27299 __tmp.put_f32_le(self.approach_x);
27300 __tmp.put_f32_le(self.approach_y);
27301 __tmp.put_f32_le(self.approach_z);
27302 __tmp.put_u8(self.target_system);
27303 __tmp.put_u64_le(self.time_usec);
27304 if matches!(version, MavlinkVersion::V2) {
27305 let len = __tmp.len();
27306 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27307 } else {
27308 __tmp.len()
27309 }
27310 }
27311}
27312#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27313#[doc = "id: 11"]
27314#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27315#[derive(Debug, Clone, PartialEq)]
27316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27318pub struct SET_MODE_DATA {
27319 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27320 pub custom_mode: u32,
27321 #[doc = "The system setting the mode"]
27322 pub target_system: u8,
27323 #[doc = "The new base mode."]
27324 pub base_mode: MavMode,
27325}
27326impl SET_MODE_DATA {
27327 pub const ENCODED_LEN: usize = 6usize;
27328 pub const DEFAULT: Self = Self {
27329 custom_mode: 0_u32,
27330 target_system: 0_u8,
27331 base_mode: MavMode::DEFAULT,
27332 };
27333 #[cfg(feature = "arbitrary")]
27334 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27335 use arbitrary::{Arbitrary, Unstructured};
27336 let mut buf = [0u8; 1024];
27337 rng.fill_bytes(&mut buf);
27338 let mut unstructured = Unstructured::new(&buf);
27339 Self::arbitrary(&mut unstructured).unwrap_or_default()
27340 }
27341}
27342impl Default for SET_MODE_DATA {
27343 fn default() -> Self {
27344 Self::DEFAULT.clone()
27345 }
27346}
27347impl MessageData for SET_MODE_DATA {
27348 type Message = MavMessage;
27349 const ID: u32 = 11u32;
27350 const NAME: &'static str = "SET_MODE";
27351 const EXTRA_CRC: u8 = 89u8;
27352 const ENCODED_LEN: usize = 6usize;
27353 fn deser(
27354 _version: MavlinkVersion,
27355 __input: &[u8],
27356 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27357 let avail_len = __input.len();
27358 let mut payload_buf = [0; Self::ENCODED_LEN];
27359 let mut buf = if avail_len < Self::ENCODED_LEN {
27360 payload_buf[0..avail_len].copy_from_slice(__input);
27361 Bytes::new(&payload_buf)
27362 } else {
27363 Bytes::new(__input)
27364 };
27365 let mut __struct = Self::default();
27366 __struct.custom_mode = buf.get_u32_le();
27367 __struct.target_system = buf.get_u8();
27368 let tmp = buf.get_u8();
27369 __struct.base_mode =
27370 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27371 enum_type: "MavMode",
27372 value: tmp as u32,
27373 })?;
27374 Ok(__struct)
27375 }
27376 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27377 let mut __tmp = BytesMut::new(bytes);
27378 #[allow(clippy::absurd_extreme_comparisons)]
27379 #[allow(unused_comparisons)]
27380 if __tmp.remaining() < Self::ENCODED_LEN {
27381 panic!(
27382 "buffer is too small (need {} bytes, but got {})",
27383 Self::ENCODED_LEN,
27384 __tmp.remaining(),
27385 )
27386 }
27387 __tmp.put_u32_le(self.custom_mode);
27388 __tmp.put_u8(self.target_system);
27389 __tmp.put_u8(self.base_mode as u8);
27390 if matches!(version, MavlinkVersion::V2) {
27391 let len = __tmp.len();
27392 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27393 } else {
27394 __tmp.len()
27395 }
27396 }
27397}
27398#[doc = "id: 86"]
27399#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
27400#[derive(Debug, Clone, PartialEq)]
27401#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27402#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27403pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
27404 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
27405 pub time_boot_ms: u32,
27406 #[doc = "Latitude in WGS84 frame"]
27407 pub lat_int: i32,
27408 #[doc = "Longitude in WGS84 frame"]
27409 pub lon_int: i32,
27410 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
27411 pub alt: f32,
27412 #[doc = "X velocity in NED frame"]
27413 pub vx: f32,
27414 #[doc = "Y velocity in NED frame"]
27415 pub vy: f32,
27416 #[doc = "Z velocity in NED frame"]
27417 pub vz: f32,
27418 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27419 pub afx: f32,
27420 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27421 pub afy: f32,
27422 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27423 pub afz: f32,
27424 #[doc = "yaw setpoint"]
27425 pub yaw: f32,
27426 #[doc = "yaw rate setpoint"]
27427 pub yaw_rate: f32,
27428 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27429 pub type_mask: PositionTargetTypemask,
27430 #[doc = "System ID"]
27431 pub target_system: u8,
27432 #[doc = "Component ID"]
27433 pub target_component: u8,
27434 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
27435 pub coordinate_frame: MavFrame,
27436}
27437impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
27438 pub const ENCODED_LEN: usize = 53usize;
27439 pub const DEFAULT: Self = Self {
27440 time_boot_ms: 0_u32,
27441 lat_int: 0_i32,
27442 lon_int: 0_i32,
27443 alt: 0.0_f32,
27444 vx: 0.0_f32,
27445 vy: 0.0_f32,
27446 vz: 0.0_f32,
27447 afx: 0.0_f32,
27448 afy: 0.0_f32,
27449 afz: 0.0_f32,
27450 yaw: 0.0_f32,
27451 yaw_rate: 0.0_f32,
27452 type_mask: PositionTargetTypemask::DEFAULT,
27453 target_system: 0_u8,
27454 target_component: 0_u8,
27455 coordinate_frame: MavFrame::DEFAULT,
27456 };
27457 #[cfg(feature = "arbitrary")]
27458 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27459 use arbitrary::{Arbitrary, Unstructured};
27460 let mut buf = [0u8; 1024];
27461 rng.fill_bytes(&mut buf);
27462 let mut unstructured = Unstructured::new(&buf);
27463 Self::arbitrary(&mut unstructured).unwrap_or_default()
27464 }
27465}
27466impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27467 fn default() -> Self {
27468 Self::DEFAULT.clone()
27469 }
27470}
27471impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27472 type Message = MavMessage;
27473 const ID: u32 = 86u32;
27474 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
27475 const EXTRA_CRC: u8 = 5u8;
27476 const ENCODED_LEN: usize = 53usize;
27477 fn deser(
27478 _version: MavlinkVersion,
27479 __input: &[u8],
27480 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27481 let avail_len = __input.len();
27482 let mut payload_buf = [0; Self::ENCODED_LEN];
27483 let mut buf = if avail_len < Self::ENCODED_LEN {
27484 payload_buf[0..avail_len].copy_from_slice(__input);
27485 Bytes::new(&payload_buf)
27486 } else {
27487 Bytes::new(__input)
27488 };
27489 let mut __struct = Self::default();
27490 __struct.time_boot_ms = buf.get_u32_le();
27491 __struct.lat_int = buf.get_i32_le();
27492 __struct.lon_int = buf.get_i32_le();
27493 __struct.alt = buf.get_f32_le();
27494 __struct.vx = buf.get_f32_le();
27495 __struct.vy = buf.get_f32_le();
27496 __struct.vz = buf.get_f32_le();
27497 __struct.afx = buf.get_f32_le();
27498 __struct.afy = buf.get_f32_le();
27499 __struct.afz = buf.get_f32_le();
27500 __struct.yaw = buf.get_f32_le();
27501 __struct.yaw_rate = buf.get_f32_le();
27502 let tmp = buf.get_u16_le();
27503 __struct.type_mask = PositionTargetTypemask::from_bits(
27504 tmp & PositionTargetTypemask::all().bits(),
27505 )
27506 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27507 flag_type: "PositionTargetTypemask",
27508 value: tmp as u32,
27509 })?;
27510 __struct.target_system = buf.get_u8();
27511 __struct.target_component = buf.get_u8();
27512 let tmp = buf.get_u8();
27513 __struct.coordinate_frame =
27514 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27515 enum_type: "MavFrame",
27516 value: tmp as u32,
27517 })?;
27518 Ok(__struct)
27519 }
27520 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27521 let mut __tmp = BytesMut::new(bytes);
27522 #[allow(clippy::absurd_extreme_comparisons)]
27523 #[allow(unused_comparisons)]
27524 if __tmp.remaining() < Self::ENCODED_LEN {
27525 panic!(
27526 "buffer is too small (need {} bytes, but got {})",
27527 Self::ENCODED_LEN,
27528 __tmp.remaining(),
27529 )
27530 }
27531 __tmp.put_u32_le(self.time_boot_ms);
27532 __tmp.put_i32_le(self.lat_int);
27533 __tmp.put_i32_le(self.lon_int);
27534 __tmp.put_f32_le(self.alt);
27535 __tmp.put_f32_le(self.vx);
27536 __tmp.put_f32_le(self.vy);
27537 __tmp.put_f32_le(self.vz);
27538 __tmp.put_f32_le(self.afx);
27539 __tmp.put_f32_le(self.afy);
27540 __tmp.put_f32_le(self.afz);
27541 __tmp.put_f32_le(self.yaw);
27542 __tmp.put_f32_le(self.yaw_rate);
27543 __tmp.put_u16_le(self.type_mask.bits());
27544 __tmp.put_u8(self.target_system);
27545 __tmp.put_u8(self.target_component);
27546 __tmp.put_u8(self.coordinate_frame as u8);
27547 if matches!(version, MavlinkVersion::V2) {
27548 let len = __tmp.len();
27549 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27550 } else {
27551 __tmp.len()
27552 }
27553 }
27554}
27555#[doc = "id: 84"]
27556#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
27557#[derive(Debug, Clone, PartialEq)]
27558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27559#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27560pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
27561 #[doc = "Timestamp (time since system boot)."]
27562 pub time_boot_ms: u32,
27563 #[doc = "X Position in NED frame"]
27564 pub x: f32,
27565 #[doc = "Y Position in NED frame"]
27566 pub y: f32,
27567 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
27568 pub z: f32,
27569 #[doc = "X velocity in NED frame"]
27570 pub vx: f32,
27571 #[doc = "Y velocity in NED frame"]
27572 pub vy: f32,
27573 #[doc = "Z velocity in NED frame"]
27574 pub vz: f32,
27575 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27576 pub afx: f32,
27577 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27578 pub afy: f32,
27579 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27580 pub afz: f32,
27581 #[doc = "yaw setpoint"]
27582 pub yaw: f32,
27583 #[doc = "yaw rate setpoint"]
27584 pub yaw_rate: f32,
27585 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27586 pub type_mask: PositionTargetTypemask,
27587 #[doc = "System ID"]
27588 pub target_system: u8,
27589 #[doc = "Component ID"]
27590 pub target_component: u8,
27591 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
27592 pub coordinate_frame: MavFrame,
27593}
27594impl SET_POSITION_TARGET_LOCAL_NED_DATA {
27595 pub const ENCODED_LEN: usize = 53usize;
27596 pub const DEFAULT: Self = Self {
27597 time_boot_ms: 0_u32,
27598 x: 0.0_f32,
27599 y: 0.0_f32,
27600 z: 0.0_f32,
27601 vx: 0.0_f32,
27602 vy: 0.0_f32,
27603 vz: 0.0_f32,
27604 afx: 0.0_f32,
27605 afy: 0.0_f32,
27606 afz: 0.0_f32,
27607 yaw: 0.0_f32,
27608 yaw_rate: 0.0_f32,
27609 type_mask: PositionTargetTypemask::DEFAULT,
27610 target_system: 0_u8,
27611 target_component: 0_u8,
27612 coordinate_frame: MavFrame::DEFAULT,
27613 };
27614 #[cfg(feature = "arbitrary")]
27615 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27616 use arbitrary::{Arbitrary, Unstructured};
27617 let mut buf = [0u8; 1024];
27618 rng.fill_bytes(&mut buf);
27619 let mut unstructured = Unstructured::new(&buf);
27620 Self::arbitrary(&mut unstructured).unwrap_or_default()
27621 }
27622}
27623impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
27624 fn default() -> Self {
27625 Self::DEFAULT.clone()
27626 }
27627}
27628impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
27629 type Message = MavMessage;
27630 const ID: u32 = 84u32;
27631 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
27632 const EXTRA_CRC: u8 = 143u8;
27633 const ENCODED_LEN: usize = 53usize;
27634 fn deser(
27635 _version: MavlinkVersion,
27636 __input: &[u8],
27637 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27638 let avail_len = __input.len();
27639 let mut payload_buf = [0; Self::ENCODED_LEN];
27640 let mut buf = if avail_len < Self::ENCODED_LEN {
27641 payload_buf[0..avail_len].copy_from_slice(__input);
27642 Bytes::new(&payload_buf)
27643 } else {
27644 Bytes::new(__input)
27645 };
27646 let mut __struct = Self::default();
27647 __struct.time_boot_ms = buf.get_u32_le();
27648 __struct.x = buf.get_f32_le();
27649 __struct.y = buf.get_f32_le();
27650 __struct.z = buf.get_f32_le();
27651 __struct.vx = buf.get_f32_le();
27652 __struct.vy = buf.get_f32_le();
27653 __struct.vz = buf.get_f32_le();
27654 __struct.afx = buf.get_f32_le();
27655 __struct.afy = buf.get_f32_le();
27656 __struct.afz = buf.get_f32_le();
27657 __struct.yaw = buf.get_f32_le();
27658 __struct.yaw_rate = buf.get_f32_le();
27659 let tmp = buf.get_u16_le();
27660 __struct.type_mask = PositionTargetTypemask::from_bits(
27661 tmp & PositionTargetTypemask::all().bits(),
27662 )
27663 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27664 flag_type: "PositionTargetTypemask",
27665 value: tmp as u32,
27666 })?;
27667 __struct.target_system = buf.get_u8();
27668 __struct.target_component = buf.get_u8();
27669 let tmp = buf.get_u8();
27670 __struct.coordinate_frame =
27671 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27672 enum_type: "MavFrame",
27673 value: tmp as u32,
27674 })?;
27675 Ok(__struct)
27676 }
27677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27678 let mut __tmp = BytesMut::new(bytes);
27679 #[allow(clippy::absurd_extreme_comparisons)]
27680 #[allow(unused_comparisons)]
27681 if __tmp.remaining() < Self::ENCODED_LEN {
27682 panic!(
27683 "buffer is too small (need {} bytes, but got {})",
27684 Self::ENCODED_LEN,
27685 __tmp.remaining(),
27686 )
27687 }
27688 __tmp.put_u32_le(self.time_boot_ms);
27689 __tmp.put_f32_le(self.x);
27690 __tmp.put_f32_le(self.y);
27691 __tmp.put_f32_le(self.z);
27692 __tmp.put_f32_le(self.vx);
27693 __tmp.put_f32_le(self.vy);
27694 __tmp.put_f32_le(self.vz);
27695 __tmp.put_f32_le(self.afx);
27696 __tmp.put_f32_le(self.afy);
27697 __tmp.put_f32_le(self.afz);
27698 __tmp.put_f32_le(self.yaw);
27699 __tmp.put_f32_le(self.yaw_rate);
27700 __tmp.put_u16_le(self.type_mask.bits());
27701 __tmp.put_u8(self.target_system);
27702 __tmp.put_u8(self.target_component);
27703 __tmp.put_u8(self.coordinate_frame as u8);
27704 if matches!(version, MavlinkVersion::V2) {
27705 let len = __tmp.len();
27706 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27707 } else {
27708 __tmp.len()
27709 }
27710 }
27711}
27712#[doc = "id: 108"]
27713#[doc = "Status of simulation environment, if used."]
27714#[derive(Debug, Clone, PartialEq)]
27715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27717pub struct SIM_STATE_DATA {
27718 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
27719 pub q1: f32,
27720 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
27721 pub q2: f32,
27722 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
27723 pub q3: f32,
27724 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
27725 pub q4: f32,
27726 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
27727 pub roll: f32,
27728 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
27729 pub pitch: f32,
27730 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
27731 pub yaw: f32,
27732 #[doc = "X acceleration"]
27733 pub xacc: f32,
27734 #[doc = "Y acceleration"]
27735 pub yacc: f32,
27736 #[doc = "Z acceleration"]
27737 pub zacc: f32,
27738 #[doc = "Angular speed around X axis"]
27739 pub xgyro: f32,
27740 #[doc = "Angular speed around Y axis"]
27741 pub ygyro: f32,
27742 #[doc = "Angular speed around Z axis"]
27743 pub zgyro: f32,
27744 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
27745 pub lat: f32,
27746 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
27747 pub lon: f32,
27748 #[doc = "Altitude"]
27749 pub alt: f32,
27750 #[doc = "Horizontal position standard deviation"]
27751 pub std_dev_horz: f32,
27752 #[doc = "Vertical position standard deviation"]
27753 pub std_dev_vert: f32,
27754 #[doc = "True velocity in north direction in earth-fixed NED frame"]
27755 pub vn: f32,
27756 #[doc = "True velocity in east direction in earth-fixed NED frame"]
27757 pub ve: f32,
27758 #[doc = "True velocity in down direction in earth-fixed NED frame"]
27759 pub vd: f32,
27760 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
27761 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27762 pub lat_int: i32,
27763 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
27764 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27765 pub lon_int: i32,
27766}
27767impl SIM_STATE_DATA {
27768 pub const ENCODED_LEN: usize = 92usize;
27769 pub const DEFAULT: Self = Self {
27770 q1: 0.0_f32,
27771 q2: 0.0_f32,
27772 q3: 0.0_f32,
27773 q4: 0.0_f32,
27774 roll: 0.0_f32,
27775 pitch: 0.0_f32,
27776 yaw: 0.0_f32,
27777 xacc: 0.0_f32,
27778 yacc: 0.0_f32,
27779 zacc: 0.0_f32,
27780 xgyro: 0.0_f32,
27781 ygyro: 0.0_f32,
27782 zgyro: 0.0_f32,
27783 lat: 0.0_f32,
27784 lon: 0.0_f32,
27785 alt: 0.0_f32,
27786 std_dev_horz: 0.0_f32,
27787 std_dev_vert: 0.0_f32,
27788 vn: 0.0_f32,
27789 ve: 0.0_f32,
27790 vd: 0.0_f32,
27791 lat_int: 0_i32,
27792 lon_int: 0_i32,
27793 };
27794 #[cfg(feature = "arbitrary")]
27795 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27796 use arbitrary::{Arbitrary, Unstructured};
27797 let mut buf = [0u8; 1024];
27798 rng.fill_bytes(&mut buf);
27799 let mut unstructured = Unstructured::new(&buf);
27800 Self::arbitrary(&mut unstructured).unwrap_or_default()
27801 }
27802}
27803impl Default for SIM_STATE_DATA {
27804 fn default() -> Self {
27805 Self::DEFAULT.clone()
27806 }
27807}
27808impl MessageData for SIM_STATE_DATA {
27809 type Message = MavMessage;
27810 const ID: u32 = 108u32;
27811 const NAME: &'static str = "SIM_STATE";
27812 const EXTRA_CRC: u8 = 32u8;
27813 const ENCODED_LEN: usize = 92usize;
27814 fn deser(
27815 _version: MavlinkVersion,
27816 __input: &[u8],
27817 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27818 let avail_len = __input.len();
27819 let mut payload_buf = [0; Self::ENCODED_LEN];
27820 let mut buf = if avail_len < Self::ENCODED_LEN {
27821 payload_buf[0..avail_len].copy_from_slice(__input);
27822 Bytes::new(&payload_buf)
27823 } else {
27824 Bytes::new(__input)
27825 };
27826 let mut __struct = Self::default();
27827 __struct.q1 = buf.get_f32_le();
27828 __struct.q2 = buf.get_f32_le();
27829 __struct.q3 = buf.get_f32_le();
27830 __struct.q4 = buf.get_f32_le();
27831 __struct.roll = buf.get_f32_le();
27832 __struct.pitch = buf.get_f32_le();
27833 __struct.yaw = buf.get_f32_le();
27834 __struct.xacc = buf.get_f32_le();
27835 __struct.yacc = buf.get_f32_le();
27836 __struct.zacc = buf.get_f32_le();
27837 __struct.xgyro = buf.get_f32_le();
27838 __struct.ygyro = buf.get_f32_le();
27839 __struct.zgyro = buf.get_f32_le();
27840 __struct.lat = buf.get_f32_le();
27841 __struct.lon = buf.get_f32_le();
27842 __struct.alt = buf.get_f32_le();
27843 __struct.std_dev_horz = buf.get_f32_le();
27844 __struct.std_dev_vert = buf.get_f32_le();
27845 __struct.vn = buf.get_f32_le();
27846 __struct.ve = buf.get_f32_le();
27847 __struct.vd = buf.get_f32_le();
27848 __struct.lat_int = buf.get_i32_le();
27849 __struct.lon_int = buf.get_i32_le();
27850 Ok(__struct)
27851 }
27852 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27853 let mut __tmp = BytesMut::new(bytes);
27854 #[allow(clippy::absurd_extreme_comparisons)]
27855 #[allow(unused_comparisons)]
27856 if __tmp.remaining() < Self::ENCODED_LEN {
27857 panic!(
27858 "buffer is too small (need {} bytes, but got {})",
27859 Self::ENCODED_LEN,
27860 __tmp.remaining(),
27861 )
27862 }
27863 __tmp.put_f32_le(self.q1);
27864 __tmp.put_f32_le(self.q2);
27865 __tmp.put_f32_le(self.q3);
27866 __tmp.put_f32_le(self.q4);
27867 __tmp.put_f32_le(self.roll);
27868 __tmp.put_f32_le(self.pitch);
27869 __tmp.put_f32_le(self.yaw);
27870 __tmp.put_f32_le(self.xacc);
27871 __tmp.put_f32_le(self.yacc);
27872 __tmp.put_f32_le(self.zacc);
27873 __tmp.put_f32_le(self.xgyro);
27874 __tmp.put_f32_le(self.ygyro);
27875 __tmp.put_f32_le(self.zgyro);
27876 __tmp.put_f32_le(self.lat);
27877 __tmp.put_f32_le(self.lon);
27878 __tmp.put_f32_le(self.alt);
27879 __tmp.put_f32_le(self.std_dev_horz);
27880 __tmp.put_f32_le(self.std_dev_vert);
27881 __tmp.put_f32_le(self.vn);
27882 __tmp.put_f32_le(self.ve);
27883 __tmp.put_f32_le(self.vd);
27884 __tmp.put_i32_le(self.lat_int);
27885 __tmp.put_i32_le(self.lon_int);
27886 if matches!(version, MavlinkVersion::V2) {
27887 let len = __tmp.len();
27888 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27889 } else {
27890 __tmp.len()
27891 }
27892 }
27893}
27894#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
27895#[doc = "id: 370"]
27896#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
27897#[derive(Debug, Clone, PartialEq)]
27898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27900pub struct SMART_BATTERY_INFO_DATA {
27901 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
27902 pub capacity_full_specification: i32,
27903 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
27904 pub capacity_full: i32,
27905 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
27906 pub cycle_count: u16,
27907 #[doc = "Battery weight. 0: field not provided."]
27908 pub weight: u16,
27909 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
27910 pub discharge_minimum_voltage: u16,
27911 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
27912 pub charging_minimum_voltage: u16,
27913 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
27914 pub resting_minimum_voltage: u16,
27915 #[doc = "Battery ID"]
27916 pub id: u8,
27917 #[doc = "Function of the battery"]
27918 pub battery_function: MavBatteryFunction,
27919 #[doc = "Type (chemistry) of the battery"]
27920 pub mavtype: MavBatteryType,
27921 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
27922 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27923 pub serial_number: [u8; 16],
27924 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
27925 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27926 pub device_name: [u8; 50],
27927 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
27928 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27929 pub charging_maximum_voltage: u16,
27930 #[doc = "Number of battery cells in series. 0: field not provided."]
27931 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27932 pub cells_in_series: u8,
27933 #[doc = "Maximum pack discharge current. 0: field not provided."]
27934 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27935 pub discharge_maximum_current: u32,
27936 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
27937 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27938 pub discharge_maximum_burst_current: u32,
27939 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
27940 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27941 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27942 pub manufacture_date: [u8; 11],
27943}
27944impl SMART_BATTERY_INFO_DATA {
27945 pub const ENCODED_LEN: usize = 109usize;
27946 pub const DEFAULT: Self = Self {
27947 capacity_full_specification: 0_i32,
27948 capacity_full: 0_i32,
27949 cycle_count: 0_u16,
27950 weight: 0_u16,
27951 discharge_minimum_voltage: 0_u16,
27952 charging_minimum_voltage: 0_u16,
27953 resting_minimum_voltage: 0_u16,
27954 id: 0_u8,
27955 battery_function: MavBatteryFunction::DEFAULT,
27956 mavtype: MavBatteryType::DEFAULT,
27957 serial_number: [0_u8; 16usize],
27958 device_name: [0_u8; 50usize],
27959 charging_maximum_voltage: 0_u16,
27960 cells_in_series: 0_u8,
27961 discharge_maximum_current: 0_u32,
27962 discharge_maximum_burst_current: 0_u32,
27963 manufacture_date: [0_u8; 11usize],
27964 };
27965 #[cfg(feature = "arbitrary")]
27966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27967 use arbitrary::{Arbitrary, Unstructured};
27968 let mut buf = [0u8; 1024];
27969 rng.fill_bytes(&mut buf);
27970 let mut unstructured = Unstructured::new(&buf);
27971 Self::arbitrary(&mut unstructured).unwrap_or_default()
27972 }
27973}
27974impl Default for SMART_BATTERY_INFO_DATA {
27975 fn default() -> Self {
27976 Self::DEFAULT.clone()
27977 }
27978}
27979impl MessageData for SMART_BATTERY_INFO_DATA {
27980 type Message = MavMessage;
27981 const ID: u32 = 370u32;
27982 const NAME: &'static str = "SMART_BATTERY_INFO";
27983 const EXTRA_CRC: u8 = 75u8;
27984 const ENCODED_LEN: usize = 109usize;
27985 fn deser(
27986 _version: MavlinkVersion,
27987 __input: &[u8],
27988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27989 let avail_len = __input.len();
27990 let mut payload_buf = [0; Self::ENCODED_LEN];
27991 let mut buf = if avail_len < Self::ENCODED_LEN {
27992 payload_buf[0..avail_len].copy_from_slice(__input);
27993 Bytes::new(&payload_buf)
27994 } else {
27995 Bytes::new(__input)
27996 };
27997 let mut __struct = Self::default();
27998 __struct.capacity_full_specification = buf.get_i32_le();
27999 __struct.capacity_full = buf.get_i32_le();
28000 __struct.cycle_count = buf.get_u16_le();
28001 __struct.weight = buf.get_u16_le();
28002 __struct.discharge_minimum_voltage = buf.get_u16_le();
28003 __struct.charging_minimum_voltage = buf.get_u16_le();
28004 __struct.resting_minimum_voltage = buf.get_u16_le();
28005 __struct.id = buf.get_u8();
28006 let tmp = buf.get_u8();
28007 __struct.battery_function =
28008 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28009 enum_type: "MavBatteryFunction",
28010 value: tmp as u32,
28011 })?;
28012 let tmp = buf.get_u8();
28013 __struct.mavtype =
28014 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28015 enum_type: "MavBatteryType",
28016 value: tmp as u32,
28017 })?;
28018 for v in &mut __struct.serial_number {
28019 let val = buf.get_u8();
28020 *v = val;
28021 }
28022 for v in &mut __struct.device_name {
28023 let val = buf.get_u8();
28024 *v = val;
28025 }
28026 __struct.charging_maximum_voltage = buf.get_u16_le();
28027 __struct.cells_in_series = buf.get_u8();
28028 __struct.discharge_maximum_current = buf.get_u32_le();
28029 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28030 for v in &mut __struct.manufacture_date {
28031 let val = buf.get_u8();
28032 *v = val;
28033 }
28034 Ok(__struct)
28035 }
28036 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28037 let mut __tmp = BytesMut::new(bytes);
28038 #[allow(clippy::absurd_extreme_comparisons)]
28039 #[allow(unused_comparisons)]
28040 if __tmp.remaining() < Self::ENCODED_LEN {
28041 panic!(
28042 "buffer is too small (need {} bytes, but got {})",
28043 Self::ENCODED_LEN,
28044 __tmp.remaining(),
28045 )
28046 }
28047 __tmp.put_i32_le(self.capacity_full_specification);
28048 __tmp.put_i32_le(self.capacity_full);
28049 __tmp.put_u16_le(self.cycle_count);
28050 __tmp.put_u16_le(self.weight);
28051 __tmp.put_u16_le(self.discharge_minimum_voltage);
28052 __tmp.put_u16_le(self.charging_minimum_voltage);
28053 __tmp.put_u16_le(self.resting_minimum_voltage);
28054 __tmp.put_u8(self.id);
28055 __tmp.put_u8(self.battery_function as u8);
28056 __tmp.put_u8(self.mavtype as u8);
28057 for val in &self.serial_number {
28058 __tmp.put_u8(*val);
28059 }
28060 for val in &self.device_name {
28061 __tmp.put_u8(*val);
28062 }
28063 __tmp.put_u16_le(self.charging_maximum_voltage);
28064 __tmp.put_u8(self.cells_in_series);
28065 __tmp.put_u32_le(self.discharge_maximum_current);
28066 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28067 for val in &self.manufacture_date {
28068 __tmp.put_u8(*val);
28069 }
28070 if matches!(version, MavlinkVersion::V2) {
28071 let len = __tmp.len();
28072 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28073 } else {
28074 __tmp.len()
28075 }
28076 }
28077}
28078#[doc = "id: 253"]
28079#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28080#[derive(Debug, Clone, PartialEq)]
28081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28083pub struct STATUSTEXT_DATA {
28084 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28085 pub severity: MavSeverity,
28086 #[doc = "Status text message, without null termination character"]
28087 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28088 pub text: [u8; 50],
28089 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28090 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28091 pub id: u16,
28092 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28093 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28094 pub chunk_seq: u8,
28095}
28096impl STATUSTEXT_DATA {
28097 pub const ENCODED_LEN: usize = 54usize;
28098 pub const DEFAULT: Self = Self {
28099 severity: MavSeverity::DEFAULT,
28100 text: [0_u8; 50usize],
28101 id: 0_u16,
28102 chunk_seq: 0_u8,
28103 };
28104 #[cfg(feature = "arbitrary")]
28105 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28106 use arbitrary::{Arbitrary, Unstructured};
28107 let mut buf = [0u8; 1024];
28108 rng.fill_bytes(&mut buf);
28109 let mut unstructured = Unstructured::new(&buf);
28110 Self::arbitrary(&mut unstructured).unwrap_or_default()
28111 }
28112}
28113impl Default for STATUSTEXT_DATA {
28114 fn default() -> Self {
28115 Self::DEFAULT.clone()
28116 }
28117}
28118impl MessageData for STATUSTEXT_DATA {
28119 type Message = MavMessage;
28120 const ID: u32 = 253u32;
28121 const NAME: &'static str = "STATUSTEXT";
28122 const EXTRA_CRC: u8 = 83u8;
28123 const ENCODED_LEN: usize = 54usize;
28124 fn deser(
28125 _version: MavlinkVersion,
28126 __input: &[u8],
28127 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28128 let avail_len = __input.len();
28129 let mut payload_buf = [0; Self::ENCODED_LEN];
28130 let mut buf = if avail_len < Self::ENCODED_LEN {
28131 payload_buf[0..avail_len].copy_from_slice(__input);
28132 Bytes::new(&payload_buf)
28133 } else {
28134 Bytes::new(__input)
28135 };
28136 let mut __struct = Self::default();
28137 let tmp = buf.get_u8();
28138 __struct.severity =
28139 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28140 enum_type: "MavSeverity",
28141 value: tmp as u32,
28142 })?;
28143 for v in &mut __struct.text {
28144 let val = buf.get_u8();
28145 *v = val;
28146 }
28147 __struct.id = buf.get_u16_le();
28148 __struct.chunk_seq = buf.get_u8();
28149 Ok(__struct)
28150 }
28151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28152 let mut __tmp = BytesMut::new(bytes);
28153 #[allow(clippy::absurd_extreme_comparisons)]
28154 #[allow(unused_comparisons)]
28155 if __tmp.remaining() < Self::ENCODED_LEN {
28156 panic!(
28157 "buffer is too small (need {} bytes, but got {})",
28158 Self::ENCODED_LEN,
28159 __tmp.remaining(),
28160 )
28161 }
28162 __tmp.put_u8(self.severity as u8);
28163 for val in &self.text {
28164 __tmp.put_u8(*val);
28165 }
28166 __tmp.put_u16_le(self.id);
28167 __tmp.put_u8(self.chunk_seq);
28168 if matches!(version, MavlinkVersion::V2) {
28169 let len = __tmp.len();
28170 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28171 } else {
28172 __tmp.len()
28173 }
28174 }
28175}
28176#[doc = "id: 261"]
28177#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28178#[derive(Debug, Clone, PartialEq)]
28179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28180#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28181pub struct STORAGE_INFORMATION_DATA {
28182 #[doc = "Timestamp (time since system boot)."]
28183 pub time_boot_ms: u32,
28184 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28185 pub total_capacity: f32,
28186 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28187 pub used_capacity: f32,
28188 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28189 pub available_capacity: f32,
28190 #[doc = "Read speed."]
28191 pub read_speed: f32,
28192 #[doc = "Write speed."]
28193 pub write_speed: f32,
28194 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28195 pub storage_id: u8,
28196 #[doc = "Number of storage devices"]
28197 pub storage_count: u8,
28198 #[doc = "Status of storage"]
28199 pub status: StorageStatus,
28200 #[doc = "Type of storage"]
28201 #[cfg_attr(feature = "serde", serde(default))]
28202 pub mavtype: StorageType,
28203 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28204 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28205 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28206 pub name: [u8; 32],
28207 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28208 #[cfg_attr(feature = "serde", serde(default))]
28209 pub storage_usage: StorageUsageFlag,
28210}
28211impl STORAGE_INFORMATION_DATA {
28212 pub const ENCODED_LEN: usize = 61usize;
28213 pub const DEFAULT: Self = Self {
28214 time_boot_ms: 0_u32,
28215 total_capacity: 0.0_f32,
28216 used_capacity: 0.0_f32,
28217 available_capacity: 0.0_f32,
28218 read_speed: 0.0_f32,
28219 write_speed: 0.0_f32,
28220 storage_id: 0_u8,
28221 storage_count: 0_u8,
28222 status: StorageStatus::DEFAULT,
28223 mavtype: StorageType::DEFAULT,
28224 name: [0_u8; 32usize],
28225 storage_usage: StorageUsageFlag::DEFAULT,
28226 };
28227 #[cfg(feature = "arbitrary")]
28228 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28229 use arbitrary::{Arbitrary, Unstructured};
28230 let mut buf = [0u8; 1024];
28231 rng.fill_bytes(&mut buf);
28232 let mut unstructured = Unstructured::new(&buf);
28233 Self::arbitrary(&mut unstructured).unwrap_or_default()
28234 }
28235}
28236impl Default for STORAGE_INFORMATION_DATA {
28237 fn default() -> Self {
28238 Self::DEFAULT.clone()
28239 }
28240}
28241impl MessageData for STORAGE_INFORMATION_DATA {
28242 type Message = MavMessage;
28243 const ID: u32 = 261u32;
28244 const NAME: &'static str = "STORAGE_INFORMATION";
28245 const EXTRA_CRC: u8 = 179u8;
28246 const ENCODED_LEN: usize = 61usize;
28247 fn deser(
28248 _version: MavlinkVersion,
28249 __input: &[u8],
28250 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28251 let avail_len = __input.len();
28252 let mut payload_buf = [0; Self::ENCODED_LEN];
28253 let mut buf = if avail_len < Self::ENCODED_LEN {
28254 payload_buf[0..avail_len].copy_from_slice(__input);
28255 Bytes::new(&payload_buf)
28256 } else {
28257 Bytes::new(__input)
28258 };
28259 let mut __struct = Self::default();
28260 __struct.time_boot_ms = buf.get_u32_le();
28261 __struct.total_capacity = buf.get_f32_le();
28262 __struct.used_capacity = buf.get_f32_le();
28263 __struct.available_capacity = buf.get_f32_le();
28264 __struct.read_speed = buf.get_f32_le();
28265 __struct.write_speed = buf.get_f32_le();
28266 __struct.storage_id = buf.get_u8();
28267 __struct.storage_count = buf.get_u8();
28268 let tmp = buf.get_u8();
28269 __struct.status =
28270 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28271 enum_type: "StorageStatus",
28272 value: tmp as u32,
28273 })?;
28274 let tmp = buf.get_u8();
28275 __struct.mavtype =
28276 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28277 enum_type: "StorageType",
28278 value: tmp as u32,
28279 })?;
28280 for v in &mut __struct.name {
28281 let val = buf.get_u8();
28282 *v = val;
28283 }
28284 let tmp = buf.get_u8();
28285 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28286 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28287 flag_type: "StorageUsageFlag",
28288 value: tmp as u32,
28289 })?;
28290 Ok(__struct)
28291 }
28292 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28293 let mut __tmp = BytesMut::new(bytes);
28294 #[allow(clippy::absurd_extreme_comparisons)]
28295 #[allow(unused_comparisons)]
28296 if __tmp.remaining() < Self::ENCODED_LEN {
28297 panic!(
28298 "buffer is too small (need {} bytes, but got {})",
28299 Self::ENCODED_LEN,
28300 __tmp.remaining(),
28301 )
28302 }
28303 __tmp.put_u32_le(self.time_boot_ms);
28304 __tmp.put_f32_le(self.total_capacity);
28305 __tmp.put_f32_le(self.used_capacity);
28306 __tmp.put_f32_le(self.available_capacity);
28307 __tmp.put_f32_le(self.read_speed);
28308 __tmp.put_f32_le(self.write_speed);
28309 __tmp.put_u8(self.storage_id);
28310 __tmp.put_u8(self.storage_count);
28311 __tmp.put_u8(self.status as u8);
28312 __tmp.put_u8(self.mavtype as u8);
28313 for val in &self.name {
28314 __tmp.put_u8(*val);
28315 }
28316 __tmp.put_u8(self.storage_usage.bits());
28317 if matches!(version, MavlinkVersion::V2) {
28318 let len = __tmp.len();
28319 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28320 } else {
28321 __tmp.len()
28322 }
28323 }
28324}
28325#[doc = "id: 401"]
28326#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
28327#[derive(Debug, Clone, PartialEq)]
28328#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28329#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28330pub struct SUPPORTED_TUNES_DATA {
28331 #[doc = "Bitfield of supported tune formats."]
28332 pub format: TuneFormat,
28333 #[doc = "System ID"]
28334 pub target_system: u8,
28335 #[doc = "Component ID"]
28336 pub target_component: u8,
28337}
28338impl SUPPORTED_TUNES_DATA {
28339 pub const ENCODED_LEN: usize = 6usize;
28340 pub const DEFAULT: Self = Self {
28341 format: TuneFormat::DEFAULT,
28342 target_system: 0_u8,
28343 target_component: 0_u8,
28344 };
28345 #[cfg(feature = "arbitrary")]
28346 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28347 use arbitrary::{Arbitrary, Unstructured};
28348 let mut buf = [0u8; 1024];
28349 rng.fill_bytes(&mut buf);
28350 let mut unstructured = Unstructured::new(&buf);
28351 Self::arbitrary(&mut unstructured).unwrap_or_default()
28352 }
28353}
28354impl Default for SUPPORTED_TUNES_DATA {
28355 fn default() -> Self {
28356 Self::DEFAULT.clone()
28357 }
28358}
28359impl MessageData for SUPPORTED_TUNES_DATA {
28360 type Message = MavMessage;
28361 const ID: u32 = 401u32;
28362 const NAME: &'static str = "SUPPORTED_TUNES";
28363 const EXTRA_CRC: u8 = 183u8;
28364 const ENCODED_LEN: usize = 6usize;
28365 fn deser(
28366 _version: MavlinkVersion,
28367 __input: &[u8],
28368 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28369 let avail_len = __input.len();
28370 let mut payload_buf = [0; Self::ENCODED_LEN];
28371 let mut buf = if avail_len < Self::ENCODED_LEN {
28372 payload_buf[0..avail_len].copy_from_slice(__input);
28373 Bytes::new(&payload_buf)
28374 } else {
28375 Bytes::new(__input)
28376 };
28377 let mut __struct = Self::default();
28378 let tmp = buf.get_u32_le();
28379 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
28380 ::mavlink_core::error::ParserError::InvalidEnum {
28381 enum_type: "TuneFormat",
28382 value: tmp as u32,
28383 },
28384 )?;
28385 __struct.target_system = buf.get_u8();
28386 __struct.target_component = buf.get_u8();
28387 Ok(__struct)
28388 }
28389 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28390 let mut __tmp = BytesMut::new(bytes);
28391 #[allow(clippy::absurd_extreme_comparisons)]
28392 #[allow(unused_comparisons)]
28393 if __tmp.remaining() < Self::ENCODED_LEN {
28394 panic!(
28395 "buffer is too small (need {} bytes, but got {})",
28396 Self::ENCODED_LEN,
28397 __tmp.remaining(),
28398 )
28399 }
28400 __tmp.put_u32_le(self.format as u32);
28401 __tmp.put_u8(self.target_system);
28402 __tmp.put_u8(self.target_component);
28403 if matches!(version, MavlinkVersion::V2) {
28404 let len = __tmp.len();
28405 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28406 } else {
28407 __tmp.len()
28408 }
28409 }
28410}
28411#[doc = "id: 2"]
28412#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
28413#[derive(Debug, Clone, PartialEq)]
28414#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28416pub struct SYSTEM_TIME_DATA {
28417 #[doc = "Timestamp (UNIX epoch time)."]
28418 pub time_unix_usec: u64,
28419 #[doc = "Timestamp (time since system boot)."]
28420 pub time_boot_ms: u32,
28421}
28422impl SYSTEM_TIME_DATA {
28423 pub const ENCODED_LEN: usize = 12usize;
28424 pub const DEFAULT: Self = Self {
28425 time_unix_usec: 0_u64,
28426 time_boot_ms: 0_u32,
28427 };
28428 #[cfg(feature = "arbitrary")]
28429 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28430 use arbitrary::{Arbitrary, Unstructured};
28431 let mut buf = [0u8; 1024];
28432 rng.fill_bytes(&mut buf);
28433 let mut unstructured = Unstructured::new(&buf);
28434 Self::arbitrary(&mut unstructured).unwrap_or_default()
28435 }
28436}
28437impl Default for SYSTEM_TIME_DATA {
28438 fn default() -> Self {
28439 Self::DEFAULT.clone()
28440 }
28441}
28442impl MessageData for SYSTEM_TIME_DATA {
28443 type Message = MavMessage;
28444 const ID: u32 = 2u32;
28445 const NAME: &'static str = "SYSTEM_TIME";
28446 const EXTRA_CRC: u8 = 137u8;
28447 const ENCODED_LEN: usize = 12usize;
28448 fn deser(
28449 _version: MavlinkVersion,
28450 __input: &[u8],
28451 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28452 let avail_len = __input.len();
28453 let mut payload_buf = [0; Self::ENCODED_LEN];
28454 let mut buf = if avail_len < Self::ENCODED_LEN {
28455 payload_buf[0..avail_len].copy_from_slice(__input);
28456 Bytes::new(&payload_buf)
28457 } else {
28458 Bytes::new(__input)
28459 };
28460 let mut __struct = Self::default();
28461 __struct.time_unix_usec = buf.get_u64_le();
28462 __struct.time_boot_ms = buf.get_u32_le();
28463 Ok(__struct)
28464 }
28465 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28466 let mut __tmp = BytesMut::new(bytes);
28467 #[allow(clippy::absurd_extreme_comparisons)]
28468 #[allow(unused_comparisons)]
28469 if __tmp.remaining() < Self::ENCODED_LEN {
28470 panic!(
28471 "buffer is too small (need {} bytes, but got {})",
28472 Self::ENCODED_LEN,
28473 __tmp.remaining(),
28474 )
28475 }
28476 __tmp.put_u64_le(self.time_unix_usec);
28477 __tmp.put_u32_le(self.time_boot_ms);
28478 if matches!(version, MavlinkVersion::V2) {
28479 let len = __tmp.len();
28480 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28481 } else {
28482 __tmp.len()
28483 }
28484 }
28485}
28486#[doc = "id: 1"]
28487#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
28488#[derive(Debug, Clone, PartialEq)]
28489#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28490#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28491pub struct SYS_STATUS_DATA {
28492 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28493 pub onboard_control_sensors_present: MavSysStatusSensor,
28494 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28495 pub onboard_control_sensors_enabled: MavSysStatusSensor,
28496 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28497 pub onboard_control_sensors_health: MavSysStatusSensor,
28498 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
28499 pub load: u16,
28500 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
28501 pub voltage_battery: u16,
28502 #[doc = "Battery current, -1: Current not sent by autopilot"]
28503 pub current_battery: i16,
28504 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28505 pub drop_rate_comm: u16,
28506 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28507 pub errors_comm: u16,
28508 #[doc = "Autopilot-specific errors"]
28509 pub errors_count1: u16,
28510 #[doc = "Autopilot-specific errors"]
28511 pub errors_count2: u16,
28512 #[doc = "Autopilot-specific errors"]
28513 pub errors_count3: u16,
28514 #[doc = "Autopilot-specific errors"]
28515 pub errors_count4: u16,
28516 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
28517 pub battery_remaining: i8,
28518 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28519 #[cfg_attr(feature = "serde", serde(default))]
28520 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
28521 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28522 #[cfg_attr(feature = "serde", serde(default))]
28523 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
28524 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28525 #[cfg_attr(feature = "serde", serde(default))]
28526 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
28527}
28528impl SYS_STATUS_DATA {
28529 pub const ENCODED_LEN: usize = 43usize;
28530 pub const DEFAULT: Self = Self {
28531 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
28532 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
28533 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
28534 load: 0_u16,
28535 voltage_battery: 0_u16,
28536 current_battery: 0_i16,
28537 drop_rate_comm: 0_u16,
28538 errors_comm: 0_u16,
28539 errors_count1: 0_u16,
28540 errors_count2: 0_u16,
28541 errors_count3: 0_u16,
28542 errors_count4: 0_u16,
28543 battery_remaining: 0_i8,
28544 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
28545 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
28546 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
28547 };
28548 #[cfg(feature = "arbitrary")]
28549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28550 use arbitrary::{Arbitrary, Unstructured};
28551 let mut buf = [0u8; 1024];
28552 rng.fill_bytes(&mut buf);
28553 let mut unstructured = Unstructured::new(&buf);
28554 Self::arbitrary(&mut unstructured).unwrap_or_default()
28555 }
28556}
28557impl Default for SYS_STATUS_DATA {
28558 fn default() -> Self {
28559 Self::DEFAULT.clone()
28560 }
28561}
28562impl MessageData for SYS_STATUS_DATA {
28563 type Message = MavMessage;
28564 const ID: u32 = 1u32;
28565 const NAME: &'static str = "SYS_STATUS";
28566 const EXTRA_CRC: u8 = 124u8;
28567 const ENCODED_LEN: usize = 43usize;
28568 fn deser(
28569 _version: MavlinkVersion,
28570 __input: &[u8],
28571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28572 let avail_len = __input.len();
28573 let mut payload_buf = [0; Self::ENCODED_LEN];
28574 let mut buf = if avail_len < Self::ENCODED_LEN {
28575 payload_buf[0..avail_len].copy_from_slice(__input);
28576 Bytes::new(&payload_buf)
28577 } else {
28578 Bytes::new(__input)
28579 };
28580 let mut __struct = Self::default();
28581 let tmp = buf.get_u32_le();
28582 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
28583 tmp & MavSysStatusSensor::all().bits(),
28584 )
28585 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28586 flag_type: "MavSysStatusSensor",
28587 value: tmp as u32,
28588 })?;
28589 let tmp = buf.get_u32_le();
28590 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
28591 tmp & MavSysStatusSensor::all().bits(),
28592 )
28593 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28594 flag_type: "MavSysStatusSensor",
28595 value: tmp as u32,
28596 })?;
28597 let tmp = buf.get_u32_le();
28598 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
28599 tmp & MavSysStatusSensor::all().bits(),
28600 )
28601 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28602 flag_type: "MavSysStatusSensor",
28603 value: tmp as u32,
28604 })?;
28605 __struct.load = buf.get_u16_le();
28606 __struct.voltage_battery = buf.get_u16_le();
28607 __struct.current_battery = buf.get_i16_le();
28608 __struct.drop_rate_comm = buf.get_u16_le();
28609 __struct.errors_comm = buf.get_u16_le();
28610 __struct.errors_count1 = buf.get_u16_le();
28611 __struct.errors_count2 = buf.get_u16_le();
28612 __struct.errors_count3 = buf.get_u16_le();
28613 __struct.errors_count4 = buf.get_u16_le();
28614 __struct.battery_remaining = buf.get_i8();
28615 let tmp = buf.get_u32_le();
28616 __struct.onboard_control_sensors_present_extended =
28617 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28618 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28619 flag_type: "MavSysStatusSensorExtended",
28620 value: tmp as u32,
28621 })?;
28622 let tmp = buf.get_u32_le();
28623 __struct.onboard_control_sensors_enabled_extended =
28624 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28625 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28626 flag_type: "MavSysStatusSensorExtended",
28627 value: tmp as u32,
28628 })?;
28629 let tmp = buf.get_u32_le();
28630 __struct.onboard_control_sensors_health_extended =
28631 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28632 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28633 flag_type: "MavSysStatusSensorExtended",
28634 value: tmp as u32,
28635 })?;
28636 Ok(__struct)
28637 }
28638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28639 let mut __tmp = BytesMut::new(bytes);
28640 #[allow(clippy::absurd_extreme_comparisons)]
28641 #[allow(unused_comparisons)]
28642 if __tmp.remaining() < Self::ENCODED_LEN {
28643 panic!(
28644 "buffer is too small (need {} bytes, but got {})",
28645 Self::ENCODED_LEN,
28646 __tmp.remaining(),
28647 )
28648 }
28649 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
28650 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
28651 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
28652 __tmp.put_u16_le(self.load);
28653 __tmp.put_u16_le(self.voltage_battery);
28654 __tmp.put_i16_le(self.current_battery);
28655 __tmp.put_u16_le(self.drop_rate_comm);
28656 __tmp.put_u16_le(self.errors_comm);
28657 __tmp.put_u16_le(self.errors_count1);
28658 __tmp.put_u16_le(self.errors_count2);
28659 __tmp.put_u16_le(self.errors_count3);
28660 __tmp.put_u16_le(self.errors_count4);
28661 __tmp.put_i8(self.battery_remaining);
28662 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
28663 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
28664 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
28665 if matches!(version, MavlinkVersion::V2) {
28666 let len = __tmp.len();
28667 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28668 } else {
28669 __tmp.len()
28670 }
28671 }
28672}
28673#[doc = "id: 135"]
28674#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
28675#[derive(Debug, Clone, PartialEq)]
28676#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28677#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28678pub struct TERRAIN_CHECK_DATA {
28679 #[doc = "Latitude"]
28680 pub lat: i32,
28681 #[doc = "Longitude"]
28682 pub lon: i32,
28683}
28684impl TERRAIN_CHECK_DATA {
28685 pub const ENCODED_LEN: usize = 8usize;
28686 pub const DEFAULT: Self = Self {
28687 lat: 0_i32,
28688 lon: 0_i32,
28689 };
28690 #[cfg(feature = "arbitrary")]
28691 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28692 use arbitrary::{Arbitrary, Unstructured};
28693 let mut buf = [0u8; 1024];
28694 rng.fill_bytes(&mut buf);
28695 let mut unstructured = Unstructured::new(&buf);
28696 Self::arbitrary(&mut unstructured).unwrap_or_default()
28697 }
28698}
28699impl Default for TERRAIN_CHECK_DATA {
28700 fn default() -> Self {
28701 Self::DEFAULT.clone()
28702 }
28703}
28704impl MessageData for TERRAIN_CHECK_DATA {
28705 type Message = MavMessage;
28706 const ID: u32 = 135u32;
28707 const NAME: &'static str = "TERRAIN_CHECK";
28708 const EXTRA_CRC: u8 = 203u8;
28709 const ENCODED_LEN: usize = 8usize;
28710 fn deser(
28711 _version: MavlinkVersion,
28712 __input: &[u8],
28713 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28714 let avail_len = __input.len();
28715 let mut payload_buf = [0; Self::ENCODED_LEN];
28716 let mut buf = if avail_len < Self::ENCODED_LEN {
28717 payload_buf[0..avail_len].copy_from_slice(__input);
28718 Bytes::new(&payload_buf)
28719 } else {
28720 Bytes::new(__input)
28721 };
28722 let mut __struct = Self::default();
28723 __struct.lat = buf.get_i32_le();
28724 __struct.lon = buf.get_i32_le();
28725 Ok(__struct)
28726 }
28727 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28728 let mut __tmp = BytesMut::new(bytes);
28729 #[allow(clippy::absurd_extreme_comparisons)]
28730 #[allow(unused_comparisons)]
28731 if __tmp.remaining() < Self::ENCODED_LEN {
28732 panic!(
28733 "buffer is too small (need {} bytes, but got {})",
28734 Self::ENCODED_LEN,
28735 __tmp.remaining(),
28736 )
28737 }
28738 __tmp.put_i32_le(self.lat);
28739 __tmp.put_i32_le(self.lon);
28740 if matches!(version, MavlinkVersion::V2) {
28741 let len = __tmp.len();
28742 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28743 } else {
28744 __tmp.len()
28745 }
28746 }
28747}
28748#[doc = "id: 134"]
28749#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28750#[derive(Debug, Clone, PartialEq)]
28751#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28752#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28753pub struct TERRAIN_DATA_DATA {
28754 #[doc = "Latitude of SW corner of first grid"]
28755 pub lat: i32,
28756 #[doc = "Longitude of SW corner of first grid"]
28757 pub lon: i32,
28758 #[doc = "Grid spacing"]
28759 pub grid_spacing: u16,
28760 #[doc = "Terrain data MSL"]
28761 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28762 pub data: [i16; 16],
28763 #[doc = "bit within the terrain request mask"]
28764 pub gridbit: u8,
28765}
28766impl TERRAIN_DATA_DATA {
28767 pub const ENCODED_LEN: usize = 43usize;
28768 pub const DEFAULT: Self = Self {
28769 lat: 0_i32,
28770 lon: 0_i32,
28771 grid_spacing: 0_u16,
28772 data: [0_i16; 16usize],
28773 gridbit: 0_u8,
28774 };
28775 #[cfg(feature = "arbitrary")]
28776 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28777 use arbitrary::{Arbitrary, Unstructured};
28778 let mut buf = [0u8; 1024];
28779 rng.fill_bytes(&mut buf);
28780 let mut unstructured = Unstructured::new(&buf);
28781 Self::arbitrary(&mut unstructured).unwrap_or_default()
28782 }
28783}
28784impl Default for TERRAIN_DATA_DATA {
28785 fn default() -> Self {
28786 Self::DEFAULT.clone()
28787 }
28788}
28789impl MessageData for TERRAIN_DATA_DATA {
28790 type Message = MavMessage;
28791 const ID: u32 = 134u32;
28792 const NAME: &'static str = "TERRAIN_DATA";
28793 const EXTRA_CRC: u8 = 229u8;
28794 const ENCODED_LEN: usize = 43usize;
28795 fn deser(
28796 _version: MavlinkVersion,
28797 __input: &[u8],
28798 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28799 let avail_len = __input.len();
28800 let mut payload_buf = [0; Self::ENCODED_LEN];
28801 let mut buf = if avail_len < Self::ENCODED_LEN {
28802 payload_buf[0..avail_len].copy_from_slice(__input);
28803 Bytes::new(&payload_buf)
28804 } else {
28805 Bytes::new(__input)
28806 };
28807 let mut __struct = Self::default();
28808 __struct.lat = buf.get_i32_le();
28809 __struct.lon = buf.get_i32_le();
28810 __struct.grid_spacing = buf.get_u16_le();
28811 for v in &mut __struct.data {
28812 let val = buf.get_i16_le();
28813 *v = val;
28814 }
28815 __struct.gridbit = buf.get_u8();
28816 Ok(__struct)
28817 }
28818 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28819 let mut __tmp = BytesMut::new(bytes);
28820 #[allow(clippy::absurd_extreme_comparisons)]
28821 #[allow(unused_comparisons)]
28822 if __tmp.remaining() < Self::ENCODED_LEN {
28823 panic!(
28824 "buffer is too small (need {} bytes, but got {})",
28825 Self::ENCODED_LEN,
28826 __tmp.remaining(),
28827 )
28828 }
28829 __tmp.put_i32_le(self.lat);
28830 __tmp.put_i32_le(self.lon);
28831 __tmp.put_u16_le(self.grid_spacing);
28832 for val in &self.data {
28833 __tmp.put_i16_le(*val);
28834 }
28835 __tmp.put_u8(self.gridbit);
28836 if matches!(version, MavlinkVersion::V2) {
28837 let len = __tmp.len();
28838 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28839 } else {
28840 __tmp.len()
28841 }
28842 }
28843}
28844#[doc = "id: 136"]
28845#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28846#[derive(Debug, Clone, PartialEq)]
28847#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28849pub struct TERRAIN_REPORT_DATA {
28850 #[doc = "Latitude"]
28851 pub lat: i32,
28852 #[doc = "Longitude"]
28853 pub lon: i32,
28854 #[doc = "Terrain height MSL"]
28855 pub terrain_height: f32,
28856 #[doc = "Current vehicle height above lat/lon terrain height"]
28857 pub current_height: f32,
28858 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
28859 pub spacing: u16,
28860 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
28861 pub pending: u16,
28862 #[doc = "Number of 4x4 terrain blocks in memory"]
28863 pub loaded: u16,
28864}
28865impl TERRAIN_REPORT_DATA {
28866 pub const ENCODED_LEN: usize = 22usize;
28867 pub const DEFAULT: Self = Self {
28868 lat: 0_i32,
28869 lon: 0_i32,
28870 terrain_height: 0.0_f32,
28871 current_height: 0.0_f32,
28872 spacing: 0_u16,
28873 pending: 0_u16,
28874 loaded: 0_u16,
28875 };
28876 #[cfg(feature = "arbitrary")]
28877 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28878 use arbitrary::{Arbitrary, Unstructured};
28879 let mut buf = [0u8; 1024];
28880 rng.fill_bytes(&mut buf);
28881 let mut unstructured = Unstructured::new(&buf);
28882 Self::arbitrary(&mut unstructured).unwrap_or_default()
28883 }
28884}
28885impl Default for TERRAIN_REPORT_DATA {
28886 fn default() -> Self {
28887 Self::DEFAULT.clone()
28888 }
28889}
28890impl MessageData for TERRAIN_REPORT_DATA {
28891 type Message = MavMessage;
28892 const ID: u32 = 136u32;
28893 const NAME: &'static str = "TERRAIN_REPORT";
28894 const EXTRA_CRC: u8 = 1u8;
28895 const ENCODED_LEN: usize = 22usize;
28896 fn deser(
28897 _version: MavlinkVersion,
28898 __input: &[u8],
28899 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28900 let avail_len = __input.len();
28901 let mut payload_buf = [0; Self::ENCODED_LEN];
28902 let mut buf = if avail_len < Self::ENCODED_LEN {
28903 payload_buf[0..avail_len].copy_from_slice(__input);
28904 Bytes::new(&payload_buf)
28905 } else {
28906 Bytes::new(__input)
28907 };
28908 let mut __struct = Self::default();
28909 __struct.lat = buf.get_i32_le();
28910 __struct.lon = buf.get_i32_le();
28911 __struct.terrain_height = buf.get_f32_le();
28912 __struct.current_height = buf.get_f32_le();
28913 __struct.spacing = buf.get_u16_le();
28914 __struct.pending = buf.get_u16_le();
28915 __struct.loaded = buf.get_u16_le();
28916 Ok(__struct)
28917 }
28918 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28919 let mut __tmp = BytesMut::new(bytes);
28920 #[allow(clippy::absurd_extreme_comparisons)]
28921 #[allow(unused_comparisons)]
28922 if __tmp.remaining() < Self::ENCODED_LEN {
28923 panic!(
28924 "buffer is too small (need {} bytes, but got {})",
28925 Self::ENCODED_LEN,
28926 __tmp.remaining(),
28927 )
28928 }
28929 __tmp.put_i32_le(self.lat);
28930 __tmp.put_i32_le(self.lon);
28931 __tmp.put_f32_le(self.terrain_height);
28932 __tmp.put_f32_le(self.current_height);
28933 __tmp.put_u16_le(self.spacing);
28934 __tmp.put_u16_le(self.pending);
28935 __tmp.put_u16_le(self.loaded);
28936 if matches!(version, MavlinkVersion::V2) {
28937 let len = __tmp.len();
28938 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28939 } else {
28940 __tmp.len()
28941 }
28942 }
28943}
28944#[doc = "id: 133"]
28945#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28946#[derive(Debug, Clone, PartialEq)]
28947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28949pub struct TERRAIN_REQUEST_DATA {
28950 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
28951 pub mask: u64,
28952 #[doc = "Latitude of SW corner of first grid"]
28953 pub lat: i32,
28954 #[doc = "Longitude of SW corner of first grid"]
28955 pub lon: i32,
28956 #[doc = "Grid spacing"]
28957 pub grid_spacing: u16,
28958}
28959impl TERRAIN_REQUEST_DATA {
28960 pub const ENCODED_LEN: usize = 18usize;
28961 pub const DEFAULT: Self = Self {
28962 mask: 0_u64,
28963 lat: 0_i32,
28964 lon: 0_i32,
28965 grid_spacing: 0_u16,
28966 };
28967 #[cfg(feature = "arbitrary")]
28968 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28969 use arbitrary::{Arbitrary, Unstructured};
28970 let mut buf = [0u8; 1024];
28971 rng.fill_bytes(&mut buf);
28972 let mut unstructured = Unstructured::new(&buf);
28973 Self::arbitrary(&mut unstructured).unwrap_or_default()
28974 }
28975}
28976impl Default for TERRAIN_REQUEST_DATA {
28977 fn default() -> Self {
28978 Self::DEFAULT.clone()
28979 }
28980}
28981impl MessageData for TERRAIN_REQUEST_DATA {
28982 type Message = MavMessage;
28983 const ID: u32 = 133u32;
28984 const NAME: &'static str = "TERRAIN_REQUEST";
28985 const EXTRA_CRC: u8 = 6u8;
28986 const ENCODED_LEN: usize = 18usize;
28987 fn deser(
28988 _version: MavlinkVersion,
28989 __input: &[u8],
28990 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28991 let avail_len = __input.len();
28992 let mut payload_buf = [0; Self::ENCODED_LEN];
28993 let mut buf = if avail_len < Self::ENCODED_LEN {
28994 payload_buf[0..avail_len].copy_from_slice(__input);
28995 Bytes::new(&payload_buf)
28996 } else {
28997 Bytes::new(__input)
28998 };
28999 let mut __struct = Self::default();
29000 __struct.mask = buf.get_u64_le();
29001 __struct.lat = buf.get_i32_le();
29002 __struct.lon = buf.get_i32_le();
29003 __struct.grid_spacing = buf.get_u16_le();
29004 Ok(__struct)
29005 }
29006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29007 let mut __tmp = BytesMut::new(bytes);
29008 #[allow(clippy::absurd_extreme_comparisons)]
29009 #[allow(unused_comparisons)]
29010 if __tmp.remaining() < Self::ENCODED_LEN {
29011 panic!(
29012 "buffer is too small (need {} bytes, but got {})",
29013 Self::ENCODED_LEN,
29014 __tmp.remaining(),
29015 )
29016 }
29017 __tmp.put_u64_le(self.mask);
29018 __tmp.put_i32_le(self.lat);
29019 __tmp.put_i32_le(self.lon);
29020 __tmp.put_u16_le(self.grid_spacing);
29021 if matches!(version, MavlinkVersion::V2) {
29022 let len = __tmp.len();
29023 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29024 } else {
29025 __tmp.len()
29026 }
29027 }
29028}
29029#[doc = "id: 111"]
29030#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29031#[derive(Debug, Clone, PartialEq)]
29032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29034pub struct TIMESYNC_DATA {
29035 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29036 pub tc1: i64,
29037 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29038 pub ts1: i64,
29039 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29040 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29041 pub target_system: u8,
29042 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29043 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29044 pub target_component: u8,
29045}
29046impl TIMESYNC_DATA {
29047 pub const ENCODED_LEN: usize = 18usize;
29048 pub const DEFAULT: Self = Self {
29049 tc1: 0_i64,
29050 ts1: 0_i64,
29051 target_system: 0_u8,
29052 target_component: 0_u8,
29053 };
29054 #[cfg(feature = "arbitrary")]
29055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29056 use arbitrary::{Arbitrary, Unstructured};
29057 let mut buf = [0u8; 1024];
29058 rng.fill_bytes(&mut buf);
29059 let mut unstructured = Unstructured::new(&buf);
29060 Self::arbitrary(&mut unstructured).unwrap_or_default()
29061 }
29062}
29063impl Default for TIMESYNC_DATA {
29064 fn default() -> Self {
29065 Self::DEFAULT.clone()
29066 }
29067}
29068impl MessageData for TIMESYNC_DATA {
29069 type Message = MavMessage;
29070 const ID: u32 = 111u32;
29071 const NAME: &'static str = "TIMESYNC";
29072 const EXTRA_CRC: u8 = 34u8;
29073 const ENCODED_LEN: usize = 18usize;
29074 fn deser(
29075 _version: MavlinkVersion,
29076 __input: &[u8],
29077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29078 let avail_len = __input.len();
29079 let mut payload_buf = [0; Self::ENCODED_LEN];
29080 let mut buf = if avail_len < Self::ENCODED_LEN {
29081 payload_buf[0..avail_len].copy_from_slice(__input);
29082 Bytes::new(&payload_buf)
29083 } else {
29084 Bytes::new(__input)
29085 };
29086 let mut __struct = Self::default();
29087 __struct.tc1 = buf.get_i64_le();
29088 __struct.ts1 = buf.get_i64_le();
29089 __struct.target_system = buf.get_u8();
29090 __struct.target_component = buf.get_u8();
29091 Ok(__struct)
29092 }
29093 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29094 let mut __tmp = BytesMut::new(bytes);
29095 #[allow(clippy::absurd_extreme_comparisons)]
29096 #[allow(unused_comparisons)]
29097 if __tmp.remaining() < Self::ENCODED_LEN {
29098 panic!(
29099 "buffer is too small (need {} bytes, but got {})",
29100 Self::ENCODED_LEN,
29101 __tmp.remaining(),
29102 )
29103 }
29104 __tmp.put_i64_le(self.tc1);
29105 __tmp.put_i64_le(self.ts1);
29106 __tmp.put_u8(self.target_system);
29107 __tmp.put_u8(self.target_component);
29108 if matches!(version, MavlinkVersion::V2) {
29109 let len = __tmp.len();
29110 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29111 } else {
29112 __tmp.len()
29113 }
29114 }
29115}
29116#[doc = "id: 380"]
29117#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
29118#[derive(Debug, Clone, PartialEq)]
29119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29121pub struct TIME_ESTIMATE_TO_TARGET_DATA {
29122 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
29123 pub safe_return: i32,
29124 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
29125 pub land: i32,
29126 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
29127 pub mission_next_item: i32,
29128 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
29129 pub mission_end: i32,
29130 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
29131 pub commanded_action: i32,
29132}
29133impl TIME_ESTIMATE_TO_TARGET_DATA {
29134 pub const ENCODED_LEN: usize = 20usize;
29135 pub const DEFAULT: Self = Self {
29136 safe_return: 0_i32,
29137 land: 0_i32,
29138 mission_next_item: 0_i32,
29139 mission_end: 0_i32,
29140 commanded_action: 0_i32,
29141 };
29142 #[cfg(feature = "arbitrary")]
29143 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29144 use arbitrary::{Arbitrary, Unstructured};
29145 let mut buf = [0u8; 1024];
29146 rng.fill_bytes(&mut buf);
29147 let mut unstructured = Unstructured::new(&buf);
29148 Self::arbitrary(&mut unstructured).unwrap_or_default()
29149 }
29150}
29151impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
29152 fn default() -> Self {
29153 Self::DEFAULT.clone()
29154 }
29155}
29156impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
29157 type Message = MavMessage;
29158 const ID: u32 = 380u32;
29159 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
29160 const EXTRA_CRC: u8 = 232u8;
29161 const ENCODED_LEN: usize = 20usize;
29162 fn deser(
29163 _version: MavlinkVersion,
29164 __input: &[u8],
29165 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29166 let avail_len = __input.len();
29167 let mut payload_buf = [0; Self::ENCODED_LEN];
29168 let mut buf = if avail_len < Self::ENCODED_LEN {
29169 payload_buf[0..avail_len].copy_from_slice(__input);
29170 Bytes::new(&payload_buf)
29171 } else {
29172 Bytes::new(__input)
29173 };
29174 let mut __struct = Self::default();
29175 __struct.safe_return = buf.get_i32_le();
29176 __struct.land = buf.get_i32_le();
29177 __struct.mission_next_item = buf.get_i32_le();
29178 __struct.mission_end = buf.get_i32_le();
29179 __struct.commanded_action = buf.get_i32_le();
29180 Ok(__struct)
29181 }
29182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29183 let mut __tmp = BytesMut::new(bytes);
29184 #[allow(clippy::absurd_extreme_comparisons)]
29185 #[allow(unused_comparisons)]
29186 if __tmp.remaining() < Self::ENCODED_LEN {
29187 panic!(
29188 "buffer is too small (need {} bytes, but got {})",
29189 Self::ENCODED_LEN,
29190 __tmp.remaining(),
29191 )
29192 }
29193 __tmp.put_i32_le(self.safe_return);
29194 __tmp.put_i32_le(self.land);
29195 __tmp.put_i32_le(self.mission_next_item);
29196 __tmp.put_i32_le(self.mission_end);
29197 __tmp.put_i32_le(self.commanded_action);
29198 if matches!(version, MavlinkVersion::V2) {
29199 let len = __tmp.len();
29200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29201 } else {
29202 __tmp.len()
29203 }
29204 }
29205}
29206#[doc = "id: 333"]
29207#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29208#[derive(Debug, Clone, PartialEq)]
29209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29211pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29212 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29213 pub time_usec: u64,
29214 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29215 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29216 pub pos_x: [f32; 5],
29217 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29218 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29219 pub pos_y: [f32; 5],
29220 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29221 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29222 pub pos_z: [f32; 5],
29223 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29224 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29225 pub delta: [f32; 5],
29226 #[doc = "Yaw. Set to NaN for unchanged"]
29227 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29228 pub pos_yaw: [f32; 5],
29229 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29230 pub valid_points: u8,
29231}
29232impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29233 pub const ENCODED_LEN: usize = 109usize;
29234 pub const DEFAULT: Self = Self {
29235 time_usec: 0_u64,
29236 pos_x: [0.0_f32; 5usize],
29237 pos_y: [0.0_f32; 5usize],
29238 pos_z: [0.0_f32; 5usize],
29239 delta: [0.0_f32; 5usize],
29240 pos_yaw: [0.0_f32; 5usize],
29241 valid_points: 0_u8,
29242 };
29243 #[cfg(feature = "arbitrary")]
29244 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29245 use arbitrary::{Arbitrary, Unstructured};
29246 let mut buf = [0u8; 1024];
29247 rng.fill_bytes(&mut buf);
29248 let mut unstructured = Unstructured::new(&buf);
29249 Self::arbitrary(&mut unstructured).unwrap_or_default()
29250 }
29251}
29252impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29253 fn default() -> Self {
29254 Self::DEFAULT.clone()
29255 }
29256}
29257impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29258 type Message = MavMessage;
29259 const ID: u32 = 333u32;
29260 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29261 const EXTRA_CRC: u8 = 231u8;
29262 const ENCODED_LEN: usize = 109usize;
29263 fn deser(
29264 _version: MavlinkVersion,
29265 __input: &[u8],
29266 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29267 let avail_len = __input.len();
29268 let mut payload_buf = [0; Self::ENCODED_LEN];
29269 let mut buf = if avail_len < Self::ENCODED_LEN {
29270 payload_buf[0..avail_len].copy_from_slice(__input);
29271 Bytes::new(&payload_buf)
29272 } else {
29273 Bytes::new(__input)
29274 };
29275 let mut __struct = Self::default();
29276 __struct.time_usec = buf.get_u64_le();
29277 for v in &mut __struct.pos_x {
29278 let val = buf.get_f32_le();
29279 *v = val;
29280 }
29281 for v in &mut __struct.pos_y {
29282 let val = buf.get_f32_le();
29283 *v = val;
29284 }
29285 for v in &mut __struct.pos_z {
29286 let val = buf.get_f32_le();
29287 *v = val;
29288 }
29289 for v in &mut __struct.delta {
29290 let val = buf.get_f32_le();
29291 *v = val;
29292 }
29293 for v in &mut __struct.pos_yaw {
29294 let val = buf.get_f32_le();
29295 *v = val;
29296 }
29297 __struct.valid_points = buf.get_u8();
29298 Ok(__struct)
29299 }
29300 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29301 let mut __tmp = BytesMut::new(bytes);
29302 #[allow(clippy::absurd_extreme_comparisons)]
29303 #[allow(unused_comparisons)]
29304 if __tmp.remaining() < Self::ENCODED_LEN {
29305 panic!(
29306 "buffer is too small (need {} bytes, but got {})",
29307 Self::ENCODED_LEN,
29308 __tmp.remaining(),
29309 )
29310 }
29311 __tmp.put_u64_le(self.time_usec);
29312 for val in &self.pos_x {
29313 __tmp.put_f32_le(*val);
29314 }
29315 for val in &self.pos_y {
29316 __tmp.put_f32_le(*val);
29317 }
29318 for val in &self.pos_z {
29319 __tmp.put_f32_le(*val);
29320 }
29321 for val in &self.delta {
29322 __tmp.put_f32_le(*val);
29323 }
29324 for val in &self.pos_yaw {
29325 __tmp.put_f32_le(*val);
29326 }
29327 __tmp.put_u8(self.valid_points);
29328 if matches!(version, MavlinkVersion::V2) {
29329 let len = __tmp.len();
29330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29331 } else {
29332 __tmp.len()
29333 }
29334 }
29335}
29336#[doc = "id: 332"]
29337#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
29338#[derive(Debug, Clone, PartialEq)]
29339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29340#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29341pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29342 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29343 pub time_usec: u64,
29344 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
29345 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29346 pub pos_x: [f32; 5],
29347 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
29348 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29349 pub pos_y: [f32; 5],
29350 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
29351 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29352 pub pos_z: [f32; 5],
29353 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
29354 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29355 pub vel_x: [f32; 5],
29356 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
29357 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29358 pub vel_y: [f32; 5],
29359 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
29360 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29361 pub vel_z: [f32; 5],
29362 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
29363 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29364 pub acc_x: [f32; 5],
29365 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
29366 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29367 pub acc_y: [f32; 5],
29368 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
29369 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29370 pub acc_z: [f32; 5],
29371 #[doc = "Yaw angle, set to NaN if not being used"]
29372 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29373 pub pos_yaw: [f32; 5],
29374 #[doc = "Yaw rate, set to NaN if not being used"]
29375 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29376 pub vel_yaw: [f32; 5],
29377 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
29378 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29379 pub command: [u16; 5],
29380 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
29381 pub valid_points: u8,
29382}
29383impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29384 pub const ENCODED_LEN: usize = 239usize;
29385 pub const DEFAULT: Self = Self {
29386 time_usec: 0_u64,
29387 pos_x: [0.0_f32; 5usize],
29388 pos_y: [0.0_f32; 5usize],
29389 pos_z: [0.0_f32; 5usize],
29390 vel_x: [0.0_f32; 5usize],
29391 vel_y: [0.0_f32; 5usize],
29392 vel_z: [0.0_f32; 5usize],
29393 acc_x: [0.0_f32; 5usize],
29394 acc_y: [0.0_f32; 5usize],
29395 acc_z: [0.0_f32; 5usize],
29396 pos_yaw: [0.0_f32; 5usize],
29397 vel_yaw: [0.0_f32; 5usize],
29398 command: [0_u16; 5usize],
29399 valid_points: 0_u8,
29400 };
29401 #[cfg(feature = "arbitrary")]
29402 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29403 use arbitrary::{Arbitrary, Unstructured};
29404 let mut buf = [0u8; 1024];
29405 rng.fill_bytes(&mut buf);
29406 let mut unstructured = Unstructured::new(&buf);
29407 Self::arbitrary(&mut unstructured).unwrap_or_default()
29408 }
29409}
29410impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29411 fn default() -> Self {
29412 Self::DEFAULT.clone()
29413 }
29414}
29415impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29416 type Message = MavMessage;
29417 const ID: u32 = 332u32;
29418 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
29419 const EXTRA_CRC: u8 = 236u8;
29420 const ENCODED_LEN: usize = 239usize;
29421 fn deser(
29422 _version: MavlinkVersion,
29423 __input: &[u8],
29424 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29425 let avail_len = __input.len();
29426 let mut payload_buf = [0; Self::ENCODED_LEN];
29427 let mut buf = if avail_len < Self::ENCODED_LEN {
29428 payload_buf[0..avail_len].copy_from_slice(__input);
29429 Bytes::new(&payload_buf)
29430 } else {
29431 Bytes::new(__input)
29432 };
29433 let mut __struct = Self::default();
29434 __struct.time_usec = buf.get_u64_le();
29435 for v in &mut __struct.pos_x {
29436 let val = buf.get_f32_le();
29437 *v = val;
29438 }
29439 for v in &mut __struct.pos_y {
29440 let val = buf.get_f32_le();
29441 *v = val;
29442 }
29443 for v in &mut __struct.pos_z {
29444 let val = buf.get_f32_le();
29445 *v = val;
29446 }
29447 for v in &mut __struct.vel_x {
29448 let val = buf.get_f32_le();
29449 *v = val;
29450 }
29451 for v in &mut __struct.vel_y {
29452 let val = buf.get_f32_le();
29453 *v = val;
29454 }
29455 for v in &mut __struct.vel_z {
29456 let val = buf.get_f32_le();
29457 *v = val;
29458 }
29459 for v in &mut __struct.acc_x {
29460 let val = buf.get_f32_le();
29461 *v = val;
29462 }
29463 for v in &mut __struct.acc_y {
29464 let val = buf.get_f32_le();
29465 *v = val;
29466 }
29467 for v in &mut __struct.acc_z {
29468 let val = buf.get_f32_le();
29469 *v = val;
29470 }
29471 for v in &mut __struct.pos_yaw {
29472 let val = buf.get_f32_le();
29473 *v = val;
29474 }
29475 for v in &mut __struct.vel_yaw {
29476 let val = buf.get_f32_le();
29477 *v = val;
29478 }
29479 for v in &mut __struct.command {
29480 let val = buf.get_u16_le();
29481 *v = val;
29482 }
29483 __struct.valid_points = buf.get_u8();
29484 Ok(__struct)
29485 }
29486 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29487 let mut __tmp = BytesMut::new(bytes);
29488 #[allow(clippy::absurd_extreme_comparisons)]
29489 #[allow(unused_comparisons)]
29490 if __tmp.remaining() < Self::ENCODED_LEN {
29491 panic!(
29492 "buffer is too small (need {} bytes, but got {})",
29493 Self::ENCODED_LEN,
29494 __tmp.remaining(),
29495 )
29496 }
29497 __tmp.put_u64_le(self.time_usec);
29498 for val in &self.pos_x {
29499 __tmp.put_f32_le(*val);
29500 }
29501 for val in &self.pos_y {
29502 __tmp.put_f32_le(*val);
29503 }
29504 for val in &self.pos_z {
29505 __tmp.put_f32_le(*val);
29506 }
29507 for val in &self.vel_x {
29508 __tmp.put_f32_le(*val);
29509 }
29510 for val in &self.vel_y {
29511 __tmp.put_f32_le(*val);
29512 }
29513 for val in &self.vel_z {
29514 __tmp.put_f32_le(*val);
29515 }
29516 for val in &self.acc_x {
29517 __tmp.put_f32_le(*val);
29518 }
29519 for val in &self.acc_y {
29520 __tmp.put_f32_le(*val);
29521 }
29522 for val in &self.acc_z {
29523 __tmp.put_f32_le(*val);
29524 }
29525 for val in &self.pos_yaw {
29526 __tmp.put_f32_le(*val);
29527 }
29528 for val in &self.vel_yaw {
29529 __tmp.put_f32_le(*val);
29530 }
29531 for val in &self.command {
29532 __tmp.put_u16_le(*val);
29533 }
29534 __tmp.put_u8(self.valid_points);
29535 if matches!(version, MavlinkVersion::V2) {
29536 let len = __tmp.len();
29537 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29538 } else {
29539 __tmp.len()
29540 }
29541 }
29542}
29543#[doc = "id: 385"]
29544#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
29545#[derive(Debug, Clone, PartialEq)]
29546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29547#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29548pub struct TUNNEL_DATA {
29549 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29550 pub payload_type: MavTunnelPayloadType,
29551 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
29552 pub target_system: u8,
29553 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
29554 pub target_component: u8,
29555 #[doc = "Length of the data transported in payload"]
29556 pub payload_length: u8,
29557 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
29558 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29559 pub payload: [u8; 128],
29560}
29561impl TUNNEL_DATA {
29562 pub const ENCODED_LEN: usize = 133usize;
29563 pub const DEFAULT: Self = Self {
29564 payload_type: MavTunnelPayloadType::DEFAULT,
29565 target_system: 0_u8,
29566 target_component: 0_u8,
29567 payload_length: 0_u8,
29568 payload: [0_u8; 128usize],
29569 };
29570 #[cfg(feature = "arbitrary")]
29571 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29572 use arbitrary::{Arbitrary, Unstructured};
29573 let mut buf = [0u8; 1024];
29574 rng.fill_bytes(&mut buf);
29575 let mut unstructured = Unstructured::new(&buf);
29576 Self::arbitrary(&mut unstructured).unwrap_or_default()
29577 }
29578}
29579impl Default for TUNNEL_DATA {
29580 fn default() -> Self {
29581 Self::DEFAULT.clone()
29582 }
29583}
29584impl MessageData for TUNNEL_DATA {
29585 type Message = MavMessage;
29586 const ID: u32 = 385u32;
29587 const NAME: &'static str = "TUNNEL";
29588 const EXTRA_CRC: u8 = 147u8;
29589 const ENCODED_LEN: usize = 133usize;
29590 fn deser(
29591 _version: MavlinkVersion,
29592 __input: &[u8],
29593 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29594 let avail_len = __input.len();
29595 let mut payload_buf = [0; Self::ENCODED_LEN];
29596 let mut buf = if avail_len < Self::ENCODED_LEN {
29597 payload_buf[0..avail_len].copy_from_slice(__input);
29598 Bytes::new(&payload_buf)
29599 } else {
29600 Bytes::new(__input)
29601 };
29602 let mut __struct = Self::default();
29603 let tmp = buf.get_u16_le();
29604 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
29605 ::mavlink_core::error::ParserError::InvalidEnum {
29606 enum_type: "MavTunnelPayloadType",
29607 value: tmp as u32,
29608 },
29609 )?;
29610 __struct.target_system = buf.get_u8();
29611 __struct.target_component = buf.get_u8();
29612 __struct.payload_length = buf.get_u8();
29613 for v in &mut __struct.payload {
29614 let val = buf.get_u8();
29615 *v = val;
29616 }
29617 Ok(__struct)
29618 }
29619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29620 let mut __tmp = BytesMut::new(bytes);
29621 #[allow(clippy::absurd_extreme_comparisons)]
29622 #[allow(unused_comparisons)]
29623 if __tmp.remaining() < Self::ENCODED_LEN {
29624 panic!(
29625 "buffer is too small (need {} bytes, but got {})",
29626 Self::ENCODED_LEN,
29627 __tmp.remaining(),
29628 )
29629 }
29630 __tmp.put_u16_le(self.payload_type as u16);
29631 __tmp.put_u8(self.target_system);
29632 __tmp.put_u8(self.target_component);
29633 __tmp.put_u8(self.payload_length);
29634 for val in &self.payload {
29635 __tmp.put_u8(*val);
29636 }
29637 if matches!(version, MavlinkVersion::V2) {
29638 let len = __tmp.len();
29639 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29640 } else {
29641 __tmp.len()
29642 }
29643 }
29644}
29645#[doc = "id: 311"]
29646#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
29647#[derive(Debug, Clone, PartialEq)]
29648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29650pub struct UAVCAN_NODE_INFO_DATA {
29651 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29652 pub time_usec: u64,
29653 #[doc = "Time since the start-up of the node."]
29654 pub uptime_sec: u32,
29655 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
29656 pub sw_vcs_commit: u32,
29657 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
29658 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29659 pub name: [u8; 80],
29660 #[doc = "Hardware major version number."]
29661 pub hw_version_major: u8,
29662 #[doc = "Hardware minor version number."]
29663 pub hw_version_minor: u8,
29664 #[doc = "Hardware unique 128-bit ID."]
29665 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29666 pub hw_unique_id: [u8; 16],
29667 #[doc = "Software major version number."]
29668 pub sw_version_major: u8,
29669 #[doc = "Software minor version number."]
29670 pub sw_version_minor: u8,
29671}
29672impl UAVCAN_NODE_INFO_DATA {
29673 pub const ENCODED_LEN: usize = 116usize;
29674 pub const DEFAULT: Self = Self {
29675 time_usec: 0_u64,
29676 uptime_sec: 0_u32,
29677 sw_vcs_commit: 0_u32,
29678 name: [0_u8; 80usize],
29679 hw_version_major: 0_u8,
29680 hw_version_minor: 0_u8,
29681 hw_unique_id: [0_u8; 16usize],
29682 sw_version_major: 0_u8,
29683 sw_version_minor: 0_u8,
29684 };
29685 #[cfg(feature = "arbitrary")]
29686 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29687 use arbitrary::{Arbitrary, Unstructured};
29688 let mut buf = [0u8; 1024];
29689 rng.fill_bytes(&mut buf);
29690 let mut unstructured = Unstructured::new(&buf);
29691 Self::arbitrary(&mut unstructured).unwrap_or_default()
29692 }
29693}
29694impl Default for UAVCAN_NODE_INFO_DATA {
29695 fn default() -> Self {
29696 Self::DEFAULT.clone()
29697 }
29698}
29699impl MessageData for UAVCAN_NODE_INFO_DATA {
29700 type Message = MavMessage;
29701 const ID: u32 = 311u32;
29702 const NAME: &'static str = "UAVCAN_NODE_INFO";
29703 const EXTRA_CRC: u8 = 95u8;
29704 const ENCODED_LEN: usize = 116usize;
29705 fn deser(
29706 _version: MavlinkVersion,
29707 __input: &[u8],
29708 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29709 let avail_len = __input.len();
29710 let mut payload_buf = [0; Self::ENCODED_LEN];
29711 let mut buf = if avail_len < Self::ENCODED_LEN {
29712 payload_buf[0..avail_len].copy_from_slice(__input);
29713 Bytes::new(&payload_buf)
29714 } else {
29715 Bytes::new(__input)
29716 };
29717 let mut __struct = Self::default();
29718 __struct.time_usec = buf.get_u64_le();
29719 __struct.uptime_sec = buf.get_u32_le();
29720 __struct.sw_vcs_commit = buf.get_u32_le();
29721 for v in &mut __struct.name {
29722 let val = buf.get_u8();
29723 *v = val;
29724 }
29725 __struct.hw_version_major = buf.get_u8();
29726 __struct.hw_version_minor = buf.get_u8();
29727 for v in &mut __struct.hw_unique_id {
29728 let val = buf.get_u8();
29729 *v = val;
29730 }
29731 __struct.sw_version_major = buf.get_u8();
29732 __struct.sw_version_minor = buf.get_u8();
29733 Ok(__struct)
29734 }
29735 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29736 let mut __tmp = BytesMut::new(bytes);
29737 #[allow(clippy::absurd_extreme_comparisons)]
29738 #[allow(unused_comparisons)]
29739 if __tmp.remaining() < Self::ENCODED_LEN {
29740 panic!(
29741 "buffer is too small (need {} bytes, but got {})",
29742 Self::ENCODED_LEN,
29743 __tmp.remaining(),
29744 )
29745 }
29746 __tmp.put_u64_le(self.time_usec);
29747 __tmp.put_u32_le(self.uptime_sec);
29748 __tmp.put_u32_le(self.sw_vcs_commit);
29749 for val in &self.name {
29750 __tmp.put_u8(*val);
29751 }
29752 __tmp.put_u8(self.hw_version_major);
29753 __tmp.put_u8(self.hw_version_minor);
29754 for val in &self.hw_unique_id {
29755 __tmp.put_u8(*val);
29756 }
29757 __tmp.put_u8(self.sw_version_major);
29758 __tmp.put_u8(self.sw_version_minor);
29759 if matches!(version, MavlinkVersion::V2) {
29760 let len = __tmp.len();
29761 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29762 } else {
29763 __tmp.len()
29764 }
29765 }
29766}
29767#[doc = "id: 310"]
29768#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
29769#[derive(Debug, Clone, PartialEq)]
29770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29772pub struct UAVCAN_NODE_STATUS_DATA {
29773 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29774 pub time_usec: u64,
29775 #[doc = "Time since the start-up of the node."]
29776 pub uptime_sec: u32,
29777 #[doc = "Vendor-specific status information."]
29778 pub vendor_specific_status_code: u16,
29779 #[doc = "Generalized node health status."]
29780 pub health: UavcanNodeHealth,
29781 #[doc = "Generalized operating mode."]
29782 pub mode: UavcanNodeMode,
29783 #[doc = "Not used currently."]
29784 pub sub_mode: u8,
29785}
29786impl UAVCAN_NODE_STATUS_DATA {
29787 pub const ENCODED_LEN: usize = 17usize;
29788 pub const DEFAULT: Self = Self {
29789 time_usec: 0_u64,
29790 uptime_sec: 0_u32,
29791 vendor_specific_status_code: 0_u16,
29792 health: UavcanNodeHealth::DEFAULT,
29793 mode: UavcanNodeMode::DEFAULT,
29794 sub_mode: 0_u8,
29795 };
29796 #[cfg(feature = "arbitrary")]
29797 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29798 use arbitrary::{Arbitrary, Unstructured};
29799 let mut buf = [0u8; 1024];
29800 rng.fill_bytes(&mut buf);
29801 let mut unstructured = Unstructured::new(&buf);
29802 Self::arbitrary(&mut unstructured).unwrap_or_default()
29803 }
29804}
29805impl Default for UAVCAN_NODE_STATUS_DATA {
29806 fn default() -> Self {
29807 Self::DEFAULT.clone()
29808 }
29809}
29810impl MessageData for UAVCAN_NODE_STATUS_DATA {
29811 type Message = MavMessage;
29812 const ID: u32 = 310u32;
29813 const NAME: &'static str = "UAVCAN_NODE_STATUS";
29814 const EXTRA_CRC: u8 = 28u8;
29815 const ENCODED_LEN: usize = 17usize;
29816 fn deser(
29817 _version: MavlinkVersion,
29818 __input: &[u8],
29819 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29820 let avail_len = __input.len();
29821 let mut payload_buf = [0; Self::ENCODED_LEN];
29822 let mut buf = if avail_len < Self::ENCODED_LEN {
29823 payload_buf[0..avail_len].copy_from_slice(__input);
29824 Bytes::new(&payload_buf)
29825 } else {
29826 Bytes::new(__input)
29827 };
29828 let mut __struct = Self::default();
29829 __struct.time_usec = buf.get_u64_le();
29830 __struct.uptime_sec = buf.get_u32_le();
29831 __struct.vendor_specific_status_code = buf.get_u16_le();
29832 let tmp = buf.get_u8();
29833 __struct.health =
29834 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29835 enum_type: "UavcanNodeHealth",
29836 value: tmp as u32,
29837 })?;
29838 let tmp = buf.get_u8();
29839 __struct.mode =
29840 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29841 enum_type: "UavcanNodeMode",
29842 value: tmp as u32,
29843 })?;
29844 __struct.sub_mode = buf.get_u8();
29845 Ok(__struct)
29846 }
29847 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29848 let mut __tmp = BytesMut::new(bytes);
29849 #[allow(clippy::absurd_extreme_comparisons)]
29850 #[allow(unused_comparisons)]
29851 if __tmp.remaining() < Self::ENCODED_LEN {
29852 panic!(
29853 "buffer is too small (need {} bytes, but got {})",
29854 Self::ENCODED_LEN,
29855 __tmp.remaining(),
29856 )
29857 }
29858 __tmp.put_u64_le(self.time_usec);
29859 __tmp.put_u32_le(self.uptime_sec);
29860 __tmp.put_u16_le(self.vendor_specific_status_code);
29861 __tmp.put_u8(self.health as u8);
29862 __tmp.put_u8(self.mode as u8);
29863 __tmp.put_u8(self.sub_mode);
29864 if matches!(version, MavlinkVersion::V2) {
29865 let len = __tmp.len();
29866 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29867 } else {
29868 __tmp.len()
29869 }
29870 }
29871}
29872#[doc = "id: 340"]
29873#[doc = "The global position resulting from GPS and sensor fusion."]
29874#[derive(Debug, Clone, PartialEq)]
29875#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29877pub struct UTM_GLOBAL_POSITION_DATA {
29878 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
29879 pub time: u64,
29880 #[doc = "Latitude (WGS84)"]
29881 pub lat: i32,
29882 #[doc = "Longitude (WGS84)"]
29883 pub lon: i32,
29884 #[doc = "Altitude (WGS84)"]
29885 pub alt: i32,
29886 #[doc = "Altitude above ground"]
29887 pub relative_alt: i32,
29888 #[doc = "Next waypoint, latitude (WGS84)"]
29889 pub next_lat: i32,
29890 #[doc = "Next waypoint, longitude (WGS84)"]
29891 pub next_lon: i32,
29892 #[doc = "Next waypoint, altitude (WGS84)"]
29893 pub next_alt: i32,
29894 #[doc = "Ground X speed (latitude, positive north)"]
29895 pub vx: i16,
29896 #[doc = "Ground Y speed (longitude, positive east)"]
29897 pub vy: i16,
29898 #[doc = "Ground Z speed (altitude, positive down)"]
29899 pub vz: i16,
29900 #[doc = "Horizontal position uncertainty (standard deviation)"]
29901 pub h_acc: u16,
29902 #[doc = "Altitude uncertainty (standard deviation)"]
29903 pub v_acc: u16,
29904 #[doc = "Speed uncertainty (standard deviation)"]
29905 pub vel_acc: u16,
29906 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
29907 pub update_rate: u16,
29908 #[doc = "Unique UAS ID."]
29909 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29910 pub uas_id: [u8; 18],
29911 #[doc = "Flight state"]
29912 pub flight_state: UtmFlightState,
29913 #[doc = "Bitwise OR combination of the data available flags."]
29914 pub flags: UtmDataAvailFlags,
29915}
29916impl UTM_GLOBAL_POSITION_DATA {
29917 pub const ENCODED_LEN: usize = 70usize;
29918 pub const DEFAULT: Self = Self {
29919 time: 0_u64,
29920 lat: 0_i32,
29921 lon: 0_i32,
29922 alt: 0_i32,
29923 relative_alt: 0_i32,
29924 next_lat: 0_i32,
29925 next_lon: 0_i32,
29926 next_alt: 0_i32,
29927 vx: 0_i16,
29928 vy: 0_i16,
29929 vz: 0_i16,
29930 h_acc: 0_u16,
29931 v_acc: 0_u16,
29932 vel_acc: 0_u16,
29933 update_rate: 0_u16,
29934 uas_id: [0_u8; 18usize],
29935 flight_state: UtmFlightState::DEFAULT,
29936 flags: UtmDataAvailFlags::DEFAULT,
29937 };
29938 #[cfg(feature = "arbitrary")]
29939 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29940 use arbitrary::{Arbitrary, Unstructured};
29941 let mut buf = [0u8; 1024];
29942 rng.fill_bytes(&mut buf);
29943 let mut unstructured = Unstructured::new(&buf);
29944 Self::arbitrary(&mut unstructured).unwrap_or_default()
29945 }
29946}
29947impl Default for UTM_GLOBAL_POSITION_DATA {
29948 fn default() -> Self {
29949 Self::DEFAULT.clone()
29950 }
29951}
29952impl MessageData for UTM_GLOBAL_POSITION_DATA {
29953 type Message = MavMessage;
29954 const ID: u32 = 340u32;
29955 const NAME: &'static str = "UTM_GLOBAL_POSITION";
29956 const EXTRA_CRC: u8 = 99u8;
29957 const ENCODED_LEN: usize = 70usize;
29958 fn deser(
29959 _version: MavlinkVersion,
29960 __input: &[u8],
29961 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29962 let avail_len = __input.len();
29963 let mut payload_buf = [0; Self::ENCODED_LEN];
29964 let mut buf = if avail_len < Self::ENCODED_LEN {
29965 payload_buf[0..avail_len].copy_from_slice(__input);
29966 Bytes::new(&payload_buf)
29967 } else {
29968 Bytes::new(__input)
29969 };
29970 let mut __struct = Self::default();
29971 __struct.time = buf.get_u64_le();
29972 __struct.lat = buf.get_i32_le();
29973 __struct.lon = buf.get_i32_le();
29974 __struct.alt = buf.get_i32_le();
29975 __struct.relative_alt = buf.get_i32_le();
29976 __struct.next_lat = buf.get_i32_le();
29977 __struct.next_lon = buf.get_i32_le();
29978 __struct.next_alt = buf.get_i32_le();
29979 __struct.vx = buf.get_i16_le();
29980 __struct.vy = buf.get_i16_le();
29981 __struct.vz = buf.get_i16_le();
29982 __struct.h_acc = buf.get_u16_le();
29983 __struct.v_acc = buf.get_u16_le();
29984 __struct.vel_acc = buf.get_u16_le();
29985 __struct.update_rate = buf.get_u16_le();
29986 for v in &mut __struct.uas_id {
29987 let val = buf.get_u8();
29988 *v = val;
29989 }
29990 let tmp = buf.get_u8();
29991 __struct.flight_state =
29992 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29993 enum_type: "UtmFlightState",
29994 value: tmp as u32,
29995 })?;
29996 let tmp = buf.get_u8();
29997 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
29998 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29999 flag_type: "UtmDataAvailFlags",
30000 value: tmp as u32,
30001 })?;
30002 Ok(__struct)
30003 }
30004 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30005 let mut __tmp = BytesMut::new(bytes);
30006 #[allow(clippy::absurd_extreme_comparisons)]
30007 #[allow(unused_comparisons)]
30008 if __tmp.remaining() < Self::ENCODED_LEN {
30009 panic!(
30010 "buffer is too small (need {} bytes, but got {})",
30011 Self::ENCODED_LEN,
30012 __tmp.remaining(),
30013 )
30014 }
30015 __tmp.put_u64_le(self.time);
30016 __tmp.put_i32_le(self.lat);
30017 __tmp.put_i32_le(self.lon);
30018 __tmp.put_i32_le(self.alt);
30019 __tmp.put_i32_le(self.relative_alt);
30020 __tmp.put_i32_le(self.next_lat);
30021 __tmp.put_i32_le(self.next_lon);
30022 __tmp.put_i32_le(self.next_alt);
30023 __tmp.put_i16_le(self.vx);
30024 __tmp.put_i16_le(self.vy);
30025 __tmp.put_i16_le(self.vz);
30026 __tmp.put_u16_le(self.h_acc);
30027 __tmp.put_u16_le(self.v_acc);
30028 __tmp.put_u16_le(self.vel_acc);
30029 __tmp.put_u16_le(self.update_rate);
30030 for val in &self.uas_id {
30031 __tmp.put_u8(*val);
30032 }
30033 __tmp.put_u8(self.flight_state as u8);
30034 __tmp.put_u8(self.flags.bits());
30035 if matches!(version, MavlinkVersion::V2) {
30036 let len = __tmp.len();
30037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30038 } else {
30039 __tmp.len()
30040 }
30041 }
30042}
30043#[doc = "id: 248"]
30044#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
30045#[derive(Debug, Clone, PartialEq)]
30046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30048pub struct V2_EXTENSION_DATA {
30049 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30050 pub message_type: u16,
30051 #[doc = "Network ID (0 for broadcast)"]
30052 pub target_network: u8,
30053 #[doc = "System ID (0 for broadcast)"]
30054 pub target_system: u8,
30055 #[doc = "Component ID (0 for broadcast)"]
30056 pub target_component: u8,
30057 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
30058 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30059 pub payload: [u8; 249],
30060}
30061impl V2_EXTENSION_DATA {
30062 pub const ENCODED_LEN: usize = 254usize;
30063 pub const DEFAULT: Self = Self {
30064 message_type: 0_u16,
30065 target_network: 0_u8,
30066 target_system: 0_u8,
30067 target_component: 0_u8,
30068 payload: [0_u8; 249usize],
30069 };
30070 #[cfg(feature = "arbitrary")]
30071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30072 use arbitrary::{Arbitrary, Unstructured};
30073 let mut buf = [0u8; 1024];
30074 rng.fill_bytes(&mut buf);
30075 let mut unstructured = Unstructured::new(&buf);
30076 Self::arbitrary(&mut unstructured).unwrap_or_default()
30077 }
30078}
30079impl Default for V2_EXTENSION_DATA {
30080 fn default() -> Self {
30081 Self::DEFAULT.clone()
30082 }
30083}
30084impl MessageData for V2_EXTENSION_DATA {
30085 type Message = MavMessage;
30086 const ID: u32 = 248u32;
30087 const NAME: &'static str = "V2_EXTENSION";
30088 const EXTRA_CRC: u8 = 8u8;
30089 const ENCODED_LEN: usize = 254usize;
30090 fn deser(
30091 _version: MavlinkVersion,
30092 __input: &[u8],
30093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30094 let avail_len = __input.len();
30095 let mut payload_buf = [0; Self::ENCODED_LEN];
30096 let mut buf = if avail_len < Self::ENCODED_LEN {
30097 payload_buf[0..avail_len].copy_from_slice(__input);
30098 Bytes::new(&payload_buf)
30099 } else {
30100 Bytes::new(__input)
30101 };
30102 let mut __struct = Self::default();
30103 __struct.message_type = buf.get_u16_le();
30104 __struct.target_network = buf.get_u8();
30105 __struct.target_system = buf.get_u8();
30106 __struct.target_component = buf.get_u8();
30107 for v in &mut __struct.payload {
30108 let val = buf.get_u8();
30109 *v = val;
30110 }
30111 Ok(__struct)
30112 }
30113 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30114 let mut __tmp = BytesMut::new(bytes);
30115 #[allow(clippy::absurd_extreme_comparisons)]
30116 #[allow(unused_comparisons)]
30117 if __tmp.remaining() < Self::ENCODED_LEN {
30118 panic!(
30119 "buffer is too small (need {} bytes, but got {})",
30120 Self::ENCODED_LEN,
30121 __tmp.remaining(),
30122 )
30123 }
30124 __tmp.put_u16_le(self.message_type);
30125 __tmp.put_u8(self.target_network);
30126 __tmp.put_u8(self.target_system);
30127 __tmp.put_u8(self.target_component);
30128 for val in &self.payload {
30129 __tmp.put_u8(*val);
30130 }
30131 if matches!(version, MavlinkVersion::V2) {
30132 let len = __tmp.len();
30133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30134 } else {
30135 __tmp.len()
30136 }
30137 }
30138}
30139#[doc = "id: 74"]
30140#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
30141#[derive(Debug, Clone, PartialEq)]
30142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30144pub struct VFR_HUD_DATA {
30145 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
30146 pub airspeed: f32,
30147 #[doc = "Current ground speed."]
30148 pub groundspeed: f32,
30149 #[doc = "Current altitude (MSL)."]
30150 pub alt: f32,
30151 #[doc = "Current climb rate."]
30152 pub climb: f32,
30153 #[doc = "Current heading in compass units (0-360, 0=north)."]
30154 pub heading: i16,
30155 #[doc = "Current throttle setting (0 to 100)."]
30156 pub throttle: u16,
30157}
30158impl VFR_HUD_DATA {
30159 pub const ENCODED_LEN: usize = 20usize;
30160 pub const DEFAULT: Self = Self {
30161 airspeed: 0.0_f32,
30162 groundspeed: 0.0_f32,
30163 alt: 0.0_f32,
30164 climb: 0.0_f32,
30165 heading: 0_i16,
30166 throttle: 0_u16,
30167 };
30168 #[cfg(feature = "arbitrary")]
30169 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30170 use arbitrary::{Arbitrary, Unstructured};
30171 let mut buf = [0u8; 1024];
30172 rng.fill_bytes(&mut buf);
30173 let mut unstructured = Unstructured::new(&buf);
30174 Self::arbitrary(&mut unstructured).unwrap_or_default()
30175 }
30176}
30177impl Default for VFR_HUD_DATA {
30178 fn default() -> Self {
30179 Self::DEFAULT.clone()
30180 }
30181}
30182impl MessageData for VFR_HUD_DATA {
30183 type Message = MavMessage;
30184 const ID: u32 = 74u32;
30185 const NAME: &'static str = "VFR_HUD";
30186 const EXTRA_CRC: u8 = 20u8;
30187 const ENCODED_LEN: usize = 20usize;
30188 fn deser(
30189 _version: MavlinkVersion,
30190 __input: &[u8],
30191 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30192 let avail_len = __input.len();
30193 let mut payload_buf = [0; Self::ENCODED_LEN];
30194 let mut buf = if avail_len < Self::ENCODED_LEN {
30195 payload_buf[0..avail_len].copy_from_slice(__input);
30196 Bytes::new(&payload_buf)
30197 } else {
30198 Bytes::new(__input)
30199 };
30200 let mut __struct = Self::default();
30201 __struct.airspeed = buf.get_f32_le();
30202 __struct.groundspeed = buf.get_f32_le();
30203 __struct.alt = buf.get_f32_le();
30204 __struct.climb = buf.get_f32_le();
30205 __struct.heading = buf.get_i16_le();
30206 __struct.throttle = buf.get_u16_le();
30207 Ok(__struct)
30208 }
30209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30210 let mut __tmp = BytesMut::new(bytes);
30211 #[allow(clippy::absurd_extreme_comparisons)]
30212 #[allow(unused_comparisons)]
30213 if __tmp.remaining() < Self::ENCODED_LEN {
30214 panic!(
30215 "buffer is too small (need {} bytes, but got {})",
30216 Self::ENCODED_LEN,
30217 __tmp.remaining(),
30218 )
30219 }
30220 __tmp.put_f32_le(self.airspeed);
30221 __tmp.put_f32_le(self.groundspeed);
30222 __tmp.put_f32_le(self.alt);
30223 __tmp.put_f32_le(self.climb);
30224 __tmp.put_i16_le(self.heading);
30225 __tmp.put_u16_le(self.throttle);
30226 if matches!(version, MavlinkVersion::V2) {
30227 let len = __tmp.len();
30228 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30229 } else {
30230 __tmp.len()
30231 }
30232 }
30233}
30234#[doc = "id: 241"]
30235#[doc = "Vibration levels and accelerometer clipping."]
30236#[derive(Debug, Clone, PartialEq)]
30237#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30238#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30239pub struct VIBRATION_DATA {
30240 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30241 pub time_usec: u64,
30242 #[doc = "Vibration levels on X-axis"]
30243 pub vibration_x: f32,
30244 #[doc = "Vibration levels on Y-axis"]
30245 pub vibration_y: f32,
30246 #[doc = "Vibration levels on Z-axis"]
30247 pub vibration_z: f32,
30248 #[doc = "first accelerometer clipping count"]
30249 pub clipping_0: u32,
30250 #[doc = "second accelerometer clipping count"]
30251 pub clipping_1: u32,
30252 #[doc = "third accelerometer clipping count"]
30253 pub clipping_2: u32,
30254}
30255impl VIBRATION_DATA {
30256 pub const ENCODED_LEN: usize = 32usize;
30257 pub const DEFAULT: Self = Self {
30258 time_usec: 0_u64,
30259 vibration_x: 0.0_f32,
30260 vibration_y: 0.0_f32,
30261 vibration_z: 0.0_f32,
30262 clipping_0: 0_u32,
30263 clipping_1: 0_u32,
30264 clipping_2: 0_u32,
30265 };
30266 #[cfg(feature = "arbitrary")]
30267 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30268 use arbitrary::{Arbitrary, Unstructured};
30269 let mut buf = [0u8; 1024];
30270 rng.fill_bytes(&mut buf);
30271 let mut unstructured = Unstructured::new(&buf);
30272 Self::arbitrary(&mut unstructured).unwrap_or_default()
30273 }
30274}
30275impl Default for VIBRATION_DATA {
30276 fn default() -> Self {
30277 Self::DEFAULT.clone()
30278 }
30279}
30280impl MessageData for VIBRATION_DATA {
30281 type Message = MavMessage;
30282 const ID: u32 = 241u32;
30283 const NAME: &'static str = "VIBRATION";
30284 const EXTRA_CRC: u8 = 90u8;
30285 const ENCODED_LEN: usize = 32usize;
30286 fn deser(
30287 _version: MavlinkVersion,
30288 __input: &[u8],
30289 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30290 let avail_len = __input.len();
30291 let mut payload_buf = [0; Self::ENCODED_LEN];
30292 let mut buf = if avail_len < Self::ENCODED_LEN {
30293 payload_buf[0..avail_len].copy_from_slice(__input);
30294 Bytes::new(&payload_buf)
30295 } else {
30296 Bytes::new(__input)
30297 };
30298 let mut __struct = Self::default();
30299 __struct.time_usec = buf.get_u64_le();
30300 __struct.vibration_x = buf.get_f32_le();
30301 __struct.vibration_y = buf.get_f32_le();
30302 __struct.vibration_z = buf.get_f32_le();
30303 __struct.clipping_0 = buf.get_u32_le();
30304 __struct.clipping_1 = buf.get_u32_le();
30305 __struct.clipping_2 = buf.get_u32_le();
30306 Ok(__struct)
30307 }
30308 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30309 let mut __tmp = BytesMut::new(bytes);
30310 #[allow(clippy::absurd_extreme_comparisons)]
30311 #[allow(unused_comparisons)]
30312 if __tmp.remaining() < Self::ENCODED_LEN {
30313 panic!(
30314 "buffer is too small (need {} bytes, but got {})",
30315 Self::ENCODED_LEN,
30316 __tmp.remaining(),
30317 )
30318 }
30319 __tmp.put_u64_le(self.time_usec);
30320 __tmp.put_f32_le(self.vibration_x);
30321 __tmp.put_f32_le(self.vibration_y);
30322 __tmp.put_f32_le(self.vibration_z);
30323 __tmp.put_u32_le(self.clipping_0);
30324 __tmp.put_u32_le(self.clipping_1);
30325 __tmp.put_u32_le(self.clipping_2);
30326 if matches!(version, MavlinkVersion::V2) {
30327 let len = __tmp.len();
30328 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30329 } else {
30330 __tmp.len()
30331 }
30332 }
30333}
30334#[doc = "id: 104"]
30335#[doc = "Global position estimate from a Vicon motion system source."]
30336#[derive(Debug, Clone, PartialEq)]
30337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30338#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30339pub struct VICON_POSITION_ESTIMATE_DATA {
30340 #[doc = "Timestamp (UNIX time or time since system boot)"]
30341 pub usec: u64,
30342 #[doc = "Global X position"]
30343 pub x: f32,
30344 #[doc = "Global Y position"]
30345 pub y: f32,
30346 #[doc = "Global Z position"]
30347 pub z: f32,
30348 #[doc = "Roll angle"]
30349 pub roll: f32,
30350 #[doc = "Pitch angle"]
30351 pub pitch: f32,
30352 #[doc = "Yaw angle"]
30353 pub yaw: f32,
30354 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30355 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30356 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30357 pub covariance: [f32; 21],
30358}
30359impl VICON_POSITION_ESTIMATE_DATA {
30360 pub const ENCODED_LEN: usize = 116usize;
30361 pub const DEFAULT: Self = Self {
30362 usec: 0_u64,
30363 x: 0.0_f32,
30364 y: 0.0_f32,
30365 z: 0.0_f32,
30366 roll: 0.0_f32,
30367 pitch: 0.0_f32,
30368 yaw: 0.0_f32,
30369 covariance: [0.0_f32; 21usize],
30370 };
30371 #[cfg(feature = "arbitrary")]
30372 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30373 use arbitrary::{Arbitrary, Unstructured};
30374 let mut buf = [0u8; 1024];
30375 rng.fill_bytes(&mut buf);
30376 let mut unstructured = Unstructured::new(&buf);
30377 Self::arbitrary(&mut unstructured).unwrap_or_default()
30378 }
30379}
30380impl Default for VICON_POSITION_ESTIMATE_DATA {
30381 fn default() -> Self {
30382 Self::DEFAULT.clone()
30383 }
30384}
30385impl MessageData for VICON_POSITION_ESTIMATE_DATA {
30386 type Message = MavMessage;
30387 const ID: u32 = 104u32;
30388 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
30389 const EXTRA_CRC: u8 = 56u8;
30390 const ENCODED_LEN: usize = 116usize;
30391 fn deser(
30392 _version: MavlinkVersion,
30393 __input: &[u8],
30394 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30395 let avail_len = __input.len();
30396 let mut payload_buf = [0; Self::ENCODED_LEN];
30397 let mut buf = if avail_len < Self::ENCODED_LEN {
30398 payload_buf[0..avail_len].copy_from_slice(__input);
30399 Bytes::new(&payload_buf)
30400 } else {
30401 Bytes::new(__input)
30402 };
30403 let mut __struct = Self::default();
30404 __struct.usec = buf.get_u64_le();
30405 __struct.x = buf.get_f32_le();
30406 __struct.y = buf.get_f32_le();
30407 __struct.z = buf.get_f32_le();
30408 __struct.roll = buf.get_f32_le();
30409 __struct.pitch = buf.get_f32_le();
30410 __struct.yaw = buf.get_f32_le();
30411 for v in &mut __struct.covariance {
30412 let val = buf.get_f32_le();
30413 *v = val;
30414 }
30415 Ok(__struct)
30416 }
30417 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30418 let mut __tmp = BytesMut::new(bytes);
30419 #[allow(clippy::absurd_extreme_comparisons)]
30420 #[allow(unused_comparisons)]
30421 if __tmp.remaining() < Self::ENCODED_LEN {
30422 panic!(
30423 "buffer is too small (need {} bytes, but got {})",
30424 Self::ENCODED_LEN,
30425 __tmp.remaining(),
30426 )
30427 }
30428 __tmp.put_u64_le(self.usec);
30429 __tmp.put_f32_le(self.x);
30430 __tmp.put_f32_le(self.y);
30431 __tmp.put_f32_le(self.z);
30432 __tmp.put_f32_le(self.roll);
30433 __tmp.put_f32_le(self.pitch);
30434 __tmp.put_f32_le(self.yaw);
30435 for val in &self.covariance {
30436 __tmp.put_f32_le(*val);
30437 }
30438 if matches!(version, MavlinkVersion::V2) {
30439 let len = __tmp.len();
30440 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30441 } else {
30442 __tmp.len()
30443 }
30444 }
30445}
30446#[doc = "id: 269"]
30447#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
30448#[derive(Debug, Clone, PartialEq)]
30449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30450#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30451pub struct VIDEO_STREAM_INFORMATION_DATA {
30452 #[doc = "Frame rate."]
30453 pub framerate: f32,
30454 #[doc = "Bit rate."]
30455 pub bitrate: u32,
30456 #[doc = "Bitmap of stream status flags."]
30457 pub flags: VideoStreamStatusFlags,
30458 #[doc = "Horizontal resolution."]
30459 pub resolution_h: u16,
30460 #[doc = "Vertical resolution."]
30461 pub resolution_v: u16,
30462 #[doc = "Video image rotation clockwise."]
30463 pub rotation: u16,
30464 #[doc = "Horizontal Field of view."]
30465 pub hfov: u16,
30466 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30467 pub stream_id: u8,
30468 #[doc = "Number of streams available."]
30469 pub count: u8,
30470 #[doc = "Type of stream."]
30471 pub mavtype: VideoStreamType,
30472 #[doc = "Stream name."]
30473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30474 pub name: [u8; 32],
30475 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
30476 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30477 pub uri: [u8; 160],
30478 #[doc = "Encoding of stream."]
30479 #[cfg_attr(feature = "serde", serde(default))]
30480 pub encoding: VideoStreamEncoding,
30481 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30482 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30483 pub camera_device_id: u8,
30484}
30485impl VIDEO_STREAM_INFORMATION_DATA {
30486 pub const ENCODED_LEN: usize = 215usize;
30487 pub const DEFAULT: Self = Self {
30488 framerate: 0.0_f32,
30489 bitrate: 0_u32,
30490 flags: VideoStreamStatusFlags::DEFAULT,
30491 resolution_h: 0_u16,
30492 resolution_v: 0_u16,
30493 rotation: 0_u16,
30494 hfov: 0_u16,
30495 stream_id: 0_u8,
30496 count: 0_u8,
30497 mavtype: VideoStreamType::DEFAULT,
30498 name: [0_u8; 32usize],
30499 uri: [0_u8; 160usize],
30500 encoding: VideoStreamEncoding::DEFAULT,
30501 camera_device_id: 0_u8,
30502 };
30503 #[cfg(feature = "arbitrary")]
30504 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30505 use arbitrary::{Arbitrary, Unstructured};
30506 let mut buf = [0u8; 1024];
30507 rng.fill_bytes(&mut buf);
30508 let mut unstructured = Unstructured::new(&buf);
30509 Self::arbitrary(&mut unstructured).unwrap_or_default()
30510 }
30511}
30512impl Default for VIDEO_STREAM_INFORMATION_DATA {
30513 fn default() -> Self {
30514 Self::DEFAULT.clone()
30515 }
30516}
30517impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
30518 type Message = MavMessage;
30519 const ID: u32 = 269u32;
30520 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
30521 const EXTRA_CRC: u8 = 109u8;
30522 const ENCODED_LEN: usize = 215usize;
30523 fn deser(
30524 _version: MavlinkVersion,
30525 __input: &[u8],
30526 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30527 let avail_len = __input.len();
30528 let mut payload_buf = [0; Self::ENCODED_LEN];
30529 let mut buf = if avail_len < Self::ENCODED_LEN {
30530 payload_buf[0..avail_len].copy_from_slice(__input);
30531 Bytes::new(&payload_buf)
30532 } else {
30533 Bytes::new(__input)
30534 };
30535 let mut __struct = Self::default();
30536 __struct.framerate = buf.get_f32_le();
30537 __struct.bitrate = buf.get_u32_le();
30538 let tmp = buf.get_u16_le();
30539 __struct.flags = VideoStreamStatusFlags::from_bits(
30540 tmp & VideoStreamStatusFlags::all().bits(),
30541 )
30542 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30543 flag_type: "VideoStreamStatusFlags",
30544 value: tmp as u32,
30545 })?;
30546 __struct.resolution_h = buf.get_u16_le();
30547 __struct.resolution_v = buf.get_u16_le();
30548 __struct.rotation = buf.get_u16_le();
30549 __struct.hfov = buf.get_u16_le();
30550 __struct.stream_id = buf.get_u8();
30551 __struct.count = buf.get_u8();
30552 let tmp = buf.get_u8();
30553 __struct.mavtype =
30554 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30555 enum_type: "VideoStreamType",
30556 value: tmp as u32,
30557 })?;
30558 for v in &mut __struct.name {
30559 let val = buf.get_u8();
30560 *v = val;
30561 }
30562 for v in &mut __struct.uri {
30563 let val = buf.get_u8();
30564 *v = val;
30565 }
30566 let tmp = buf.get_u8();
30567 __struct.encoding =
30568 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30569 enum_type: "VideoStreamEncoding",
30570 value: tmp as u32,
30571 })?;
30572 __struct.camera_device_id = buf.get_u8();
30573 Ok(__struct)
30574 }
30575 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30576 let mut __tmp = BytesMut::new(bytes);
30577 #[allow(clippy::absurd_extreme_comparisons)]
30578 #[allow(unused_comparisons)]
30579 if __tmp.remaining() < Self::ENCODED_LEN {
30580 panic!(
30581 "buffer is too small (need {} bytes, but got {})",
30582 Self::ENCODED_LEN,
30583 __tmp.remaining(),
30584 )
30585 }
30586 __tmp.put_f32_le(self.framerate);
30587 __tmp.put_u32_le(self.bitrate);
30588 __tmp.put_u16_le(self.flags.bits());
30589 __tmp.put_u16_le(self.resolution_h);
30590 __tmp.put_u16_le(self.resolution_v);
30591 __tmp.put_u16_le(self.rotation);
30592 __tmp.put_u16_le(self.hfov);
30593 __tmp.put_u8(self.stream_id);
30594 __tmp.put_u8(self.count);
30595 __tmp.put_u8(self.mavtype as u8);
30596 for val in &self.name {
30597 __tmp.put_u8(*val);
30598 }
30599 for val in &self.uri {
30600 __tmp.put_u8(*val);
30601 }
30602 __tmp.put_u8(self.encoding as u8);
30603 __tmp.put_u8(self.camera_device_id);
30604 if matches!(version, MavlinkVersion::V2) {
30605 let len = __tmp.len();
30606 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30607 } else {
30608 __tmp.len()
30609 }
30610 }
30611}
30612#[doc = "id: 270"]
30613#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
30614#[derive(Debug, Clone, PartialEq)]
30615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30617pub struct VIDEO_STREAM_STATUS_DATA {
30618 #[doc = "Frame rate"]
30619 pub framerate: f32,
30620 #[doc = "Bit rate"]
30621 pub bitrate: u32,
30622 #[doc = "Bitmap of stream status flags"]
30623 pub flags: VideoStreamStatusFlags,
30624 #[doc = "Horizontal resolution"]
30625 pub resolution_h: u16,
30626 #[doc = "Vertical resolution"]
30627 pub resolution_v: u16,
30628 #[doc = "Video image rotation clockwise"]
30629 pub rotation: u16,
30630 #[doc = "Horizontal Field of view"]
30631 pub hfov: u16,
30632 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30633 pub stream_id: u8,
30634 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30635 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30636 pub camera_device_id: u8,
30637}
30638impl VIDEO_STREAM_STATUS_DATA {
30639 pub const ENCODED_LEN: usize = 20usize;
30640 pub const DEFAULT: Self = Self {
30641 framerate: 0.0_f32,
30642 bitrate: 0_u32,
30643 flags: VideoStreamStatusFlags::DEFAULT,
30644 resolution_h: 0_u16,
30645 resolution_v: 0_u16,
30646 rotation: 0_u16,
30647 hfov: 0_u16,
30648 stream_id: 0_u8,
30649 camera_device_id: 0_u8,
30650 };
30651 #[cfg(feature = "arbitrary")]
30652 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30653 use arbitrary::{Arbitrary, Unstructured};
30654 let mut buf = [0u8; 1024];
30655 rng.fill_bytes(&mut buf);
30656 let mut unstructured = Unstructured::new(&buf);
30657 Self::arbitrary(&mut unstructured).unwrap_or_default()
30658 }
30659}
30660impl Default for VIDEO_STREAM_STATUS_DATA {
30661 fn default() -> Self {
30662 Self::DEFAULT.clone()
30663 }
30664}
30665impl MessageData for VIDEO_STREAM_STATUS_DATA {
30666 type Message = MavMessage;
30667 const ID: u32 = 270u32;
30668 const NAME: &'static str = "VIDEO_STREAM_STATUS";
30669 const EXTRA_CRC: u8 = 59u8;
30670 const ENCODED_LEN: usize = 20usize;
30671 fn deser(
30672 _version: MavlinkVersion,
30673 __input: &[u8],
30674 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30675 let avail_len = __input.len();
30676 let mut payload_buf = [0; Self::ENCODED_LEN];
30677 let mut buf = if avail_len < Self::ENCODED_LEN {
30678 payload_buf[0..avail_len].copy_from_slice(__input);
30679 Bytes::new(&payload_buf)
30680 } else {
30681 Bytes::new(__input)
30682 };
30683 let mut __struct = Self::default();
30684 __struct.framerate = buf.get_f32_le();
30685 __struct.bitrate = buf.get_u32_le();
30686 let tmp = buf.get_u16_le();
30687 __struct.flags = VideoStreamStatusFlags::from_bits(
30688 tmp & VideoStreamStatusFlags::all().bits(),
30689 )
30690 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30691 flag_type: "VideoStreamStatusFlags",
30692 value: tmp as u32,
30693 })?;
30694 __struct.resolution_h = buf.get_u16_le();
30695 __struct.resolution_v = buf.get_u16_le();
30696 __struct.rotation = buf.get_u16_le();
30697 __struct.hfov = buf.get_u16_le();
30698 __struct.stream_id = buf.get_u8();
30699 __struct.camera_device_id = buf.get_u8();
30700 Ok(__struct)
30701 }
30702 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30703 let mut __tmp = BytesMut::new(bytes);
30704 #[allow(clippy::absurd_extreme_comparisons)]
30705 #[allow(unused_comparisons)]
30706 if __tmp.remaining() < Self::ENCODED_LEN {
30707 panic!(
30708 "buffer is too small (need {} bytes, but got {})",
30709 Self::ENCODED_LEN,
30710 __tmp.remaining(),
30711 )
30712 }
30713 __tmp.put_f32_le(self.framerate);
30714 __tmp.put_u32_le(self.bitrate);
30715 __tmp.put_u16_le(self.flags.bits());
30716 __tmp.put_u16_le(self.resolution_h);
30717 __tmp.put_u16_le(self.resolution_v);
30718 __tmp.put_u16_le(self.rotation);
30719 __tmp.put_u16_le(self.hfov);
30720 __tmp.put_u8(self.stream_id);
30721 __tmp.put_u8(self.camera_device_id);
30722 if matches!(version, MavlinkVersion::V2) {
30723 let len = __tmp.len();
30724 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30725 } else {
30726 __tmp.len()
30727 }
30728 }
30729}
30730#[doc = "id: 102"]
30731#[doc = "Local position/attitude estimate from a vision source."]
30732#[derive(Debug, Clone, PartialEq)]
30733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30735pub struct VISION_POSITION_ESTIMATE_DATA {
30736 #[doc = "Timestamp (UNIX time or time since system boot)"]
30737 pub usec: u64,
30738 #[doc = "Local X position"]
30739 pub x: f32,
30740 #[doc = "Local Y position"]
30741 pub y: f32,
30742 #[doc = "Local Z position"]
30743 pub z: f32,
30744 #[doc = "Roll angle"]
30745 pub roll: f32,
30746 #[doc = "Pitch angle"]
30747 pub pitch: f32,
30748 #[doc = "Yaw angle"]
30749 pub yaw: f32,
30750 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30751 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30752 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30753 pub covariance: [f32; 21],
30754 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30755 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30756 pub reset_counter: u8,
30757}
30758impl VISION_POSITION_ESTIMATE_DATA {
30759 pub const ENCODED_LEN: usize = 117usize;
30760 pub const DEFAULT: Self = Self {
30761 usec: 0_u64,
30762 x: 0.0_f32,
30763 y: 0.0_f32,
30764 z: 0.0_f32,
30765 roll: 0.0_f32,
30766 pitch: 0.0_f32,
30767 yaw: 0.0_f32,
30768 covariance: [0.0_f32; 21usize],
30769 reset_counter: 0_u8,
30770 };
30771 #[cfg(feature = "arbitrary")]
30772 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30773 use arbitrary::{Arbitrary, Unstructured};
30774 let mut buf = [0u8; 1024];
30775 rng.fill_bytes(&mut buf);
30776 let mut unstructured = Unstructured::new(&buf);
30777 Self::arbitrary(&mut unstructured).unwrap_or_default()
30778 }
30779}
30780impl Default for VISION_POSITION_ESTIMATE_DATA {
30781 fn default() -> Self {
30782 Self::DEFAULT.clone()
30783 }
30784}
30785impl MessageData for VISION_POSITION_ESTIMATE_DATA {
30786 type Message = MavMessage;
30787 const ID: u32 = 102u32;
30788 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
30789 const EXTRA_CRC: u8 = 158u8;
30790 const ENCODED_LEN: usize = 117usize;
30791 fn deser(
30792 _version: MavlinkVersion,
30793 __input: &[u8],
30794 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30795 let avail_len = __input.len();
30796 let mut payload_buf = [0; Self::ENCODED_LEN];
30797 let mut buf = if avail_len < Self::ENCODED_LEN {
30798 payload_buf[0..avail_len].copy_from_slice(__input);
30799 Bytes::new(&payload_buf)
30800 } else {
30801 Bytes::new(__input)
30802 };
30803 let mut __struct = Self::default();
30804 __struct.usec = buf.get_u64_le();
30805 __struct.x = buf.get_f32_le();
30806 __struct.y = buf.get_f32_le();
30807 __struct.z = buf.get_f32_le();
30808 __struct.roll = buf.get_f32_le();
30809 __struct.pitch = buf.get_f32_le();
30810 __struct.yaw = buf.get_f32_le();
30811 for v in &mut __struct.covariance {
30812 let val = buf.get_f32_le();
30813 *v = val;
30814 }
30815 __struct.reset_counter = buf.get_u8();
30816 Ok(__struct)
30817 }
30818 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30819 let mut __tmp = BytesMut::new(bytes);
30820 #[allow(clippy::absurd_extreme_comparisons)]
30821 #[allow(unused_comparisons)]
30822 if __tmp.remaining() < Self::ENCODED_LEN {
30823 panic!(
30824 "buffer is too small (need {} bytes, but got {})",
30825 Self::ENCODED_LEN,
30826 __tmp.remaining(),
30827 )
30828 }
30829 __tmp.put_u64_le(self.usec);
30830 __tmp.put_f32_le(self.x);
30831 __tmp.put_f32_le(self.y);
30832 __tmp.put_f32_le(self.z);
30833 __tmp.put_f32_le(self.roll);
30834 __tmp.put_f32_le(self.pitch);
30835 __tmp.put_f32_le(self.yaw);
30836 for val in &self.covariance {
30837 __tmp.put_f32_le(*val);
30838 }
30839 __tmp.put_u8(self.reset_counter);
30840 if matches!(version, MavlinkVersion::V2) {
30841 let len = __tmp.len();
30842 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30843 } else {
30844 __tmp.len()
30845 }
30846 }
30847}
30848#[doc = "id: 103"]
30849#[doc = "Speed estimate from a vision source."]
30850#[derive(Debug, Clone, PartialEq)]
30851#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30853pub struct VISION_SPEED_ESTIMATE_DATA {
30854 #[doc = "Timestamp (UNIX time or time since system boot)"]
30855 pub usec: u64,
30856 #[doc = "Global X speed"]
30857 pub x: f32,
30858 #[doc = "Global Y speed"]
30859 pub y: f32,
30860 #[doc = "Global Z speed"]
30861 pub z: f32,
30862 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
30863 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30864 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30865 pub covariance: [f32; 9],
30866 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30867 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30868 pub reset_counter: u8,
30869}
30870impl VISION_SPEED_ESTIMATE_DATA {
30871 pub const ENCODED_LEN: usize = 57usize;
30872 pub const DEFAULT: Self = Self {
30873 usec: 0_u64,
30874 x: 0.0_f32,
30875 y: 0.0_f32,
30876 z: 0.0_f32,
30877 covariance: [0.0_f32; 9usize],
30878 reset_counter: 0_u8,
30879 };
30880 #[cfg(feature = "arbitrary")]
30881 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30882 use arbitrary::{Arbitrary, Unstructured};
30883 let mut buf = [0u8; 1024];
30884 rng.fill_bytes(&mut buf);
30885 let mut unstructured = Unstructured::new(&buf);
30886 Self::arbitrary(&mut unstructured).unwrap_or_default()
30887 }
30888}
30889impl Default for VISION_SPEED_ESTIMATE_DATA {
30890 fn default() -> Self {
30891 Self::DEFAULT.clone()
30892 }
30893}
30894impl MessageData for VISION_SPEED_ESTIMATE_DATA {
30895 type Message = MavMessage;
30896 const ID: u32 = 103u32;
30897 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
30898 const EXTRA_CRC: u8 = 208u8;
30899 const ENCODED_LEN: usize = 57usize;
30900 fn deser(
30901 _version: MavlinkVersion,
30902 __input: &[u8],
30903 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30904 let avail_len = __input.len();
30905 let mut payload_buf = [0; Self::ENCODED_LEN];
30906 let mut buf = if avail_len < Self::ENCODED_LEN {
30907 payload_buf[0..avail_len].copy_from_slice(__input);
30908 Bytes::new(&payload_buf)
30909 } else {
30910 Bytes::new(__input)
30911 };
30912 let mut __struct = Self::default();
30913 __struct.usec = buf.get_u64_le();
30914 __struct.x = buf.get_f32_le();
30915 __struct.y = buf.get_f32_le();
30916 __struct.z = buf.get_f32_le();
30917 for v in &mut __struct.covariance {
30918 let val = buf.get_f32_le();
30919 *v = val;
30920 }
30921 __struct.reset_counter = buf.get_u8();
30922 Ok(__struct)
30923 }
30924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30925 let mut __tmp = BytesMut::new(bytes);
30926 #[allow(clippy::absurd_extreme_comparisons)]
30927 #[allow(unused_comparisons)]
30928 if __tmp.remaining() < Self::ENCODED_LEN {
30929 panic!(
30930 "buffer is too small (need {} bytes, but got {})",
30931 Self::ENCODED_LEN,
30932 __tmp.remaining(),
30933 )
30934 }
30935 __tmp.put_u64_le(self.usec);
30936 __tmp.put_f32_le(self.x);
30937 __tmp.put_f32_le(self.y);
30938 __tmp.put_f32_le(self.z);
30939 for val in &self.covariance {
30940 __tmp.put_f32_le(*val);
30941 }
30942 __tmp.put_u8(self.reset_counter);
30943 if matches!(version, MavlinkVersion::V2) {
30944 let len = __tmp.len();
30945 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30946 } else {
30947 __tmp.len()
30948 }
30949 }
30950}
30951#[doc = "id: 9000"]
30952#[doc = "Cumulative distance traveled for each reported wheel."]
30953#[derive(Debug, Clone, PartialEq)]
30954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30956pub struct WHEEL_DISTANCE_DATA {
30957 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
30958 pub time_usec: u64,
30959 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
30960 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30961 pub distance: [f64; 16],
30962 #[doc = "Number of wheels reported."]
30963 pub count: u8,
30964}
30965impl WHEEL_DISTANCE_DATA {
30966 pub const ENCODED_LEN: usize = 137usize;
30967 pub const DEFAULT: Self = Self {
30968 time_usec: 0_u64,
30969 distance: [0.0_f64; 16usize],
30970 count: 0_u8,
30971 };
30972 #[cfg(feature = "arbitrary")]
30973 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30974 use arbitrary::{Arbitrary, Unstructured};
30975 let mut buf = [0u8; 1024];
30976 rng.fill_bytes(&mut buf);
30977 let mut unstructured = Unstructured::new(&buf);
30978 Self::arbitrary(&mut unstructured).unwrap_or_default()
30979 }
30980}
30981impl Default for WHEEL_DISTANCE_DATA {
30982 fn default() -> Self {
30983 Self::DEFAULT.clone()
30984 }
30985}
30986impl MessageData for WHEEL_DISTANCE_DATA {
30987 type Message = MavMessage;
30988 const ID: u32 = 9000u32;
30989 const NAME: &'static str = "WHEEL_DISTANCE";
30990 const EXTRA_CRC: u8 = 113u8;
30991 const ENCODED_LEN: usize = 137usize;
30992 fn deser(
30993 _version: MavlinkVersion,
30994 __input: &[u8],
30995 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30996 let avail_len = __input.len();
30997 let mut payload_buf = [0; Self::ENCODED_LEN];
30998 let mut buf = if avail_len < Self::ENCODED_LEN {
30999 payload_buf[0..avail_len].copy_from_slice(__input);
31000 Bytes::new(&payload_buf)
31001 } else {
31002 Bytes::new(__input)
31003 };
31004 let mut __struct = Self::default();
31005 __struct.time_usec = buf.get_u64_le();
31006 for v in &mut __struct.distance {
31007 let val = buf.get_f64_le();
31008 *v = val;
31009 }
31010 __struct.count = buf.get_u8();
31011 Ok(__struct)
31012 }
31013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31014 let mut __tmp = BytesMut::new(bytes);
31015 #[allow(clippy::absurd_extreme_comparisons)]
31016 #[allow(unused_comparisons)]
31017 if __tmp.remaining() < Self::ENCODED_LEN {
31018 panic!(
31019 "buffer is too small (need {} bytes, but got {})",
31020 Self::ENCODED_LEN,
31021 __tmp.remaining(),
31022 )
31023 }
31024 __tmp.put_u64_le(self.time_usec);
31025 for val in &self.distance {
31026 __tmp.put_f64_le(*val);
31027 }
31028 __tmp.put_u8(self.count);
31029 if matches!(version, MavlinkVersion::V2) {
31030 let len = __tmp.len();
31031 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31032 } else {
31033 __tmp.len()
31034 }
31035 }
31036}
31037#[doc = "id: 299"]
31038#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31039#[derive(Debug, Clone, PartialEq)]
31040#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31042pub struct WIFI_CONFIG_AP_DATA {
31043 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
31044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31045 pub ssid: [u8; 32],
31046 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
31047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31048 pub password: [u8; 64],
31049 #[doc = "WiFi Mode."]
31050 #[cfg_attr(feature = "serde", serde(default))]
31051 pub mode: WifiConfigApMode,
31052 #[doc = "Message acceptance response (sent back to GS)."]
31053 #[cfg_attr(feature = "serde", serde(default))]
31054 pub response: WifiConfigApResponse,
31055}
31056impl WIFI_CONFIG_AP_DATA {
31057 pub const ENCODED_LEN: usize = 98usize;
31058 pub const DEFAULT: Self = Self {
31059 ssid: [0_u8; 32usize],
31060 password: [0_u8; 64usize],
31061 mode: WifiConfigApMode::DEFAULT,
31062 response: WifiConfigApResponse::DEFAULT,
31063 };
31064 #[cfg(feature = "arbitrary")]
31065 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31066 use arbitrary::{Arbitrary, Unstructured};
31067 let mut buf = [0u8; 1024];
31068 rng.fill_bytes(&mut buf);
31069 let mut unstructured = Unstructured::new(&buf);
31070 Self::arbitrary(&mut unstructured).unwrap_or_default()
31071 }
31072}
31073impl Default for WIFI_CONFIG_AP_DATA {
31074 fn default() -> Self {
31075 Self::DEFAULT.clone()
31076 }
31077}
31078impl MessageData for WIFI_CONFIG_AP_DATA {
31079 type Message = MavMessage;
31080 const ID: u32 = 299u32;
31081 const NAME: &'static str = "WIFI_CONFIG_AP";
31082 const EXTRA_CRC: u8 = 19u8;
31083 const ENCODED_LEN: usize = 98usize;
31084 fn deser(
31085 _version: MavlinkVersion,
31086 __input: &[u8],
31087 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31088 let avail_len = __input.len();
31089 let mut payload_buf = [0; Self::ENCODED_LEN];
31090 let mut buf = if avail_len < Self::ENCODED_LEN {
31091 payload_buf[0..avail_len].copy_from_slice(__input);
31092 Bytes::new(&payload_buf)
31093 } else {
31094 Bytes::new(__input)
31095 };
31096 let mut __struct = Self::default();
31097 for v in &mut __struct.ssid {
31098 let val = buf.get_u8();
31099 *v = val;
31100 }
31101 for v in &mut __struct.password {
31102 let val = buf.get_u8();
31103 *v = val;
31104 }
31105 let tmp = buf.get_i8();
31106 __struct.mode =
31107 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31108 enum_type: "WifiConfigApMode",
31109 value: tmp as u32,
31110 })?;
31111 let tmp = buf.get_i8();
31112 __struct.response =
31113 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31114 enum_type: "WifiConfigApResponse",
31115 value: tmp as u32,
31116 })?;
31117 Ok(__struct)
31118 }
31119 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31120 let mut __tmp = BytesMut::new(bytes);
31121 #[allow(clippy::absurd_extreme_comparisons)]
31122 #[allow(unused_comparisons)]
31123 if __tmp.remaining() < Self::ENCODED_LEN {
31124 panic!(
31125 "buffer is too small (need {} bytes, but got {})",
31126 Self::ENCODED_LEN,
31127 __tmp.remaining(),
31128 )
31129 }
31130 for val in &self.ssid {
31131 __tmp.put_u8(*val);
31132 }
31133 for val in &self.password {
31134 __tmp.put_u8(*val);
31135 }
31136 __tmp.put_i8(self.mode as i8);
31137 __tmp.put_i8(self.response as i8);
31138 if matches!(version, MavlinkVersion::V2) {
31139 let len = __tmp.len();
31140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31141 } else {
31142 __tmp.len()
31143 }
31144 }
31145}
31146#[doc = "id: 9005"]
31147#[doc = "Winch status."]
31148#[derive(Debug, Clone, PartialEq)]
31149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31151pub struct WINCH_STATUS_DATA {
31152 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31153 pub time_usec: u64,
31154 #[doc = "Length of line released. NaN if unknown"]
31155 pub line_length: f32,
31156 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
31157 pub speed: f32,
31158 #[doc = "Tension on the line. NaN if unknown"]
31159 pub tension: f32,
31160 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
31161 pub voltage: f32,
31162 #[doc = "Current draw from the winch. NaN if unknown"]
31163 pub current: f32,
31164 #[doc = "Status flags"]
31165 pub status: MavWinchStatusFlag,
31166 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31167 pub temperature: i16,
31168}
31169impl WINCH_STATUS_DATA {
31170 pub const ENCODED_LEN: usize = 34usize;
31171 pub const DEFAULT: Self = Self {
31172 time_usec: 0_u64,
31173 line_length: 0.0_f32,
31174 speed: 0.0_f32,
31175 tension: 0.0_f32,
31176 voltage: 0.0_f32,
31177 current: 0.0_f32,
31178 status: MavWinchStatusFlag::DEFAULT,
31179 temperature: 0_i16,
31180 };
31181 #[cfg(feature = "arbitrary")]
31182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31183 use arbitrary::{Arbitrary, Unstructured};
31184 let mut buf = [0u8; 1024];
31185 rng.fill_bytes(&mut buf);
31186 let mut unstructured = Unstructured::new(&buf);
31187 Self::arbitrary(&mut unstructured).unwrap_or_default()
31188 }
31189}
31190impl Default for WINCH_STATUS_DATA {
31191 fn default() -> Self {
31192 Self::DEFAULT.clone()
31193 }
31194}
31195impl MessageData for WINCH_STATUS_DATA {
31196 type Message = MavMessage;
31197 const ID: u32 = 9005u32;
31198 const NAME: &'static str = "WINCH_STATUS";
31199 const EXTRA_CRC: u8 = 117u8;
31200 const ENCODED_LEN: usize = 34usize;
31201 fn deser(
31202 _version: MavlinkVersion,
31203 __input: &[u8],
31204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31205 let avail_len = __input.len();
31206 let mut payload_buf = [0; Self::ENCODED_LEN];
31207 let mut buf = if avail_len < Self::ENCODED_LEN {
31208 payload_buf[0..avail_len].copy_from_slice(__input);
31209 Bytes::new(&payload_buf)
31210 } else {
31211 Bytes::new(__input)
31212 };
31213 let mut __struct = Self::default();
31214 __struct.time_usec = buf.get_u64_le();
31215 __struct.line_length = buf.get_f32_le();
31216 __struct.speed = buf.get_f32_le();
31217 __struct.tension = buf.get_f32_le();
31218 __struct.voltage = buf.get_f32_le();
31219 __struct.current = buf.get_f32_le();
31220 let tmp = buf.get_u32_le();
31221 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
31222 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31223 flag_type: "MavWinchStatusFlag",
31224 value: tmp as u32,
31225 })?;
31226 __struct.temperature = buf.get_i16_le();
31227 Ok(__struct)
31228 }
31229 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31230 let mut __tmp = BytesMut::new(bytes);
31231 #[allow(clippy::absurd_extreme_comparisons)]
31232 #[allow(unused_comparisons)]
31233 if __tmp.remaining() < Self::ENCODED_LEN {
31234 panic!(
31235 "buffer is too small (need {} bytes, but got {})",
31236 Self::ENCODED_LEN,
31237 __tmp.remaining(),
31238 )
31239 }
31240 __tmp.put_u64_le(self.time_usec);
31241 __tmp.put_f32_le(self.line_length);
31242 __tmp.put_f32_le(self.speed);
31243 __tmp.put_f32_le(self.tension);
31244 __tmp.put_f32_le(self.voltage);
31245 __tmp.put_f32_le(self.current);
31246 __tmp.put_u32_le(self.status.bits());
31247 __tmp.put_i16_le(self.temperature);
31248 if matches!(version, MavlinkVersion::V2) {
31249 let len = __tmp.len();
31250 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31251 } else {
31252 __tmp.len()
31253 }
31254 }
31255}
31256#[doc = "id: 231"]
31257#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31258#[derive(Debug, Clone, PartialEq)]
31259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31261pub struct WIND_COV_DATA {
31262 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31263 pub time_usec: u64,
31264 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31265 pub wind_x: f32,
31266 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31267 pub wind_y: f32,
31268 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31269 pub wind_z: f32,
31270 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31271 pub var_horiz: f32,
31272 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31273 pub var_vert: f32,
31274 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31275 pub wind_alt: f32,
31276 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31277 pub horiz_accuracy: f32,
31278 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31279 pub vert_accuracy: f32,
31280}
31281impl WIND_COV_DATA {
31282 pub const ENCODED_LEN: usize = 40usize;
31283 pub const DEFAULT: Self = Self {
31284 time_usec: 0_u64,
31285 wind_x: 0.0_f32,
31286 wind_y: 0.0_f32,
31287 wind_z: 0.0_f32,
31288 var_horiz: 0.0_f32,
31289 var_vert: 0.0_f32,
31290 wind_alt: 0.0_f32,
31291 horiz_accuracy: 0.0_f32,
31292 vert_accuracy: 0.0_f32,
31293 };
31294 #[cfg(feature = "arbitrary")]
31295 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31296 use arbitrary::{Arbitrary, Unstructured};
31297 let mut buf = [0u8; 1024];
31298 rng.fill_bytes(&mut buf);
31299 let mut unstructured = Unstructured::new(&buf);
31300 Self::arbitrary(&mut unstructured).unwrap_or_default()
31301 }
31302}
31303impl Default for WIND_COV_DATA {
31304 fn default() -> Self {
31305 Self::DEFAULT.clone()
31306 }
31307}
31308impl MessageData for WIND_COV_DATA {
31309 type Message = MavMessage;
31310 const ID: u32 = 231u32;
31311 const NAME: &'static str = "WIND_COV";
31312 const EXTRA_CRC: u8 = 105u8;
31313 const ENCODED_LEN: usize = 40usize;
31314 fn deser(
31315 _version: MavlinkVersion,
31316 __input: &[u8],
31317 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31318 let avail_len = __input.len();
31319 let mut payload_buf = [0; Self::ENCODED_LEN];
31320 let mut buf = if avail_len < Self::ENCODED_LEN {
31321 payload_buf[0..avail_len].copy_from_slice(__input);
31322 Bytes::new(&payload_buf)
31323 } else {
31324 Bytes::new(__input)
31325 };
31326 let mut __struct = Self::default();
31327 __struct.time_usec = buf.get_u64_le();
31328 __struct.wind_x = buf.get_f32_le();
31329 __struct.wind_y = buf.get_f32_le();
31330 __struct.wind_z = buf.get_f32_le();
31331 __struct.var_horiz = buf.get_f32_le();
31332 __struct.var_vert = buf.get_f32_le();
31333 __struct.wind_alt = buf.get_f32_le();
31334 __struct.horiz_accuracy = buf.get_f32_le();
31335 __struct.vert_accuracy = buf.get_f32_le();
31336 Ok(__struct)
31337 }
31338 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31339 let mut __tmp = BytesMut::new(bytes);
31340 #[allow(clippy::absurd_extreme_comparisons)]
31341 #[allow(unused_comparisons)]
31342 if __tmp.remaining() < Self::ENCODED_LEN {
31343 panic!(
31344 "buffer is too small (need {} bytes, but got {})",
31345 Self::ENCODED_LEN,
31346 __tmp.remaining(),
31347 )
31348 }
31349 __tmp.put_u64_le(self.time_usec);
31350 __tmp.put_f32_le(self.wind_x);
31351 __tmp.put_f32_le(self.wind_y);
31352 __tmp.put_f32_le(self.wind_z);
31353 __tmp.put_f32_le(self.var_horiz);
31354 __tmp.put_f32_le(self.var_vert);
31355 __tmp.put_f32_le(self.wind_alt);
31356 __tmp.put_f32_le(self.horiz_accuracy);
31357 __tmp.put_f32_le(self.vert_accuracy);
31358 if matches!(version, MavlinkVersion::V2) {
31359 let len = __tmp.len();
31360 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31361 } else {
31362 __tmp.len()
31363 }
31364 }
31365}
31366#[derive(Clone, PartialEq, Debug)]
31367#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31368#[cfg_attr(feature = "serde", serde(tag = "type"))]
31369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31370#[repr(u32)]
31371pub enum MavMessage {
31372 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
31373 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
31374 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
31375 AIS_VESSEL(AIS_VESSEL_DATA),
31376 ALTITUDE(ALTITUDE_DATA),
31377 ATTITUDE(ATTITUDE_DATA),
31378 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
31379 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
31380 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
31381 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
31382 AUTH_KEY(AUTH_KEY_DATA),
31383 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
31384 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
31385 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
31386 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
31387 BATTERY_INFO(BATTERY_INFO_DATA),
31388 BATTERY_STATUS(BATTERY_STATUS_DATA),
31389 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
31390 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
31391 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
31392 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
31393 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
31394 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
31395 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
31396 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
31397 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
31398 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
31399 CANFD_FRAME(CANFD_FRAME_DATA),
31400 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
31401 CAN_FRAME(CAN_FRAME_DATA),
31402 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
31403 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
31404 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
31405 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
31406 COLLISION(COLLISION_DATA),
31407 COMMAND_ACK(COMMAND_ACK_DATA),
31408 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
31409 COMMAND_INT(COMMAND_INT_DATA),
31410 COMMAND_LONG(COMMAND_LONG_DATA),
31411 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
31412 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
31413 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
31414 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
31415 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
31416 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
31417 CURRENT_MODE(CURRENT_MODE_DATA),
31418 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
31419 DATA_STREAM(DATA_STREAM_DATA),
31420 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
31421 DEBUG(DEBUG_DATA),
31422 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
31423 DEBUG_VECT(DEBUG_VECT_DATA),
31424 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
31425 EFI_STATUS(EFI_STATUS_DATA),
31426 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
31427 ESC_INFO(ESC_INFO_DATA),
31428 ESC_STATUS(ESC_STATUS_DATA),
31429 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
31430 EVENT(EVENT_DATA),
31431 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
31432 FENCE_STATUS(FENCE_STATUS_DATA),
31433 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
31434 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
31435 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
31436 FUEL_STATUS(FUEL_STATUS_DATA),
31437 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
31438 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
31439 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
31440 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
31441 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
31442 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
31443 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
31444 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
31445 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
31446 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
31447 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
31448 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
31449 GPS2_RAW(GPS2_RAW_DATA),
31450 GPS2_RTK(GPS2_RTK_DATA),
31451 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
31452 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
31453 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
31454 GPS_INPUT(GPS_INPUT_DATA),
31455 GPS_RAW_INT(GPS_RAW_INT_DATA),
31456 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
31457 GPS_RTK(GPS_RTK_DATA),
31458 GPS_STATUS(GPS_STATUS_DATA),
31459 HEARTBEAT(HEARTBEAT_DATA),
31460 HIGHRES_IMU(HIGHRES_IMU_DATA),
31461 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
31462 HIGH_LATENCY(HIGH_LATENCY_DATA),
31463 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
31464 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
31465 HIL_CONTROLS(HIL_CONTROLS_DATA),
31466 HIL_GPS(HIL_GPS_DATA),
31467 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
31468 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
31469 HIL_SENSOR(HIL_SENSOR_DATA),
31470 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
31471 HIL_STATE(HIL_STATE_DATA),
31472 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
31473 HOME_POSITION(HOME_POSITION_DATA),
31474 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
31475 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
31476 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
31477 LANDING_TARGET(LANDING_TARGET_DATA),
31478 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
31479 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
31480 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
31481 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
31482 LOGGING_ACK(LOGGING_ACK_DATA),
31483 LOGGING_DATA(LOGGING_DATA_DATA),
31484 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
31485 LOG_DATA(LOG_DATA_DATA),
31486 LOG_ENTRY(LOG_ENTRY_DATA),
31487 LOG_ERASE(LOG_ERASE_DATA),
31488 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
31489 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
31490 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
31491 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
31492 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
31493 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
31494 MEMORY_VECT(MEMORY_VECT_DATA),
31495 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
31496 MISSION_ACK(MISSION_ACK_DATA),
31497 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
31498 MISSION_COUNT(MISSION_COUNT_DATA),
31499 MISSION_CURRENT(MISSION_CURRENT_DATA),
31500 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
31501 MISSION_ITEM(MISSION_ITEM_DATA),
31502 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
31503 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
31504 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
31505 MISSION_REQUEST(MISSION_REQUEST_DATA),
31506 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
31507 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
31508 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
31509 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
31510 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
31511 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
31512 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
31513 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
31514 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
31515 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
31516 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
31517 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
31518 ODOMETRY(ODOMETRY_DATA),
31519 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
31520 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
31521 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
31522 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
31523 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
31524 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
31525 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
31526 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
31527 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
31528 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
31529 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
31530 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
31531 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
31532 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
31533 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
31534 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
31535 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
31536 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
31537 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
31538 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
31539 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
31540 PARAM_SET(PARAM_SET_DATA),
31541 PARAM_VALUE(PARAM_VALUE_DATA),
31542 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
31543 PING(PING_DATA),
31544 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
31545 PLAY_TUNE(PLAY_TUNE_DATA),
31546 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
31547 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
31548 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
31549 POWER_STATUS(POWER_STATUS_DATA),
31550 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
31551 RADIO_STATUS(RADIO_STATUS_DATA),
31552 RAW_IMU(RAW_IMU_DATA),
31553 RAW_PRESSURE(RAW_PRESSURE_DATA),
31554 RAW_RPM(RAW_RPM_DATA),
31555 RC_CHANNELS(RC_CHANNELS_DATA),
31556 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
31557 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
31558 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
31559 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
31560 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
31561 REQUEST_EVENT(REQUEST_EVENT_DATA),
31562 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
31563 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
31564 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
31565 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
31566 SCALED_IMU(SCALED_IMU_DATA),
31567 SCALED_IMU2(SCALED_IMU2_DATA),
31568 SCALED_IMU3(SCALED_IMU3_DATA),
31569 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
31570 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
31571 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
31572 SCRIPT_COUNT(SCRIPT_COUNT_DATA),
31573 SCRIPT_CURRENT(SCRIPT_CURRENT_DATA),
31574 SCRIPT_ITEM(SCRIPT_ITEM_DATA),
31575 SCRIPT_REQUEST(SCRIPT_REQUEST_DATA),
31576 SCRIPT_REQUEST_LIST(SCRIPT_REQUEST_LIST_DATA),
31577 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
31578 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
31579 SETUP_SIGNING(SETUP_SIGNING_DATA),
31580 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
31581 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
31582 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
31583 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
31584 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
31585 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
31586 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
31587 SET_MODE(SET_MODE_DATA),
31588 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
31589 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
31590 SIM_STATE(SIM_STATE_DATA),
31591 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
31592 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
31593 STATUSTEXT(STATUSTEXT_DATA),
31594 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
31595 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
31596 SYSTEM_TIME(SYSTEM_TIME_DATA),
31597 SYS_STATUS(SYS_STATUS_DATA),
31598 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
31599 TERRAIN_DATA(TERRAIN_DATA_DATA),
31600 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
31601 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
31602 TIMESYNC(TIMESYNC_DATA),
31603 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
31604 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
31605 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
31606 TUNNEL(TUNNEL_DATA),
31607 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
31608 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
31609 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
31610 V2_EXTENSION(V2_EXTENSION_DATA),
31611 VFR_HUD(VFR_HUD_DATA),
31612 VIBRATION(VIBRATION_DATA),
31613 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
31614 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
31615 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
31616 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
31617 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
31618 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
31619 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
31620 WINCH_STATUS(WINCH_STATUS_DATA),
31621 WIND_COV(WIND_COV_DATA),
31622}
31623impl MavMessage {
31624 pub const fn all_ids() -> &'static [u32] {
31625 &[
31626 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
31627 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
31628 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
31629 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
31630 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
31631 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
31632 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
31633 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
31634 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
31635 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
31636 148u32, 149u32, 162u32, 180u32, 181u32, 182u32, 183u32, 184u32, 192u32, 225u32, 230u32,
31637 231u32, 232u32, 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32,
31638 247u32, 248u32, 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32,
31639 259u32, 260u32, 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32,
31640 270u32, 271u32, 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32,
31641 286u32, 287u32, 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32,
31642 321u32, 322u32, 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32,
31643 339u32, 340u32, 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32,
31644 386u32, 387u32, 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32,
31645 412u32, 413u32, 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 12900u32, 12901u32,
31646 12902u32, 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
31647 ]
31648 }
31649}
31650impl Message for MavMessage {
31651 fn parse(
31652 version: MavlinkVersion,
31653 id: u32,
31654 payload: &[u8],
31655 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31656 match id {
31657 ACTUATOR_CONTROL_TARGET_DATA::ID => {
31658 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
31659 .map(Self::ACTUATOR_CONTROL_TARGET)
31660 }
31661 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
31662 .map(Self::ACTUATOR_OUTPUT_STATUS),
31663 ADSB_VEHICLE_DATA::ID => {
31664 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
31665 }
31666 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
31667 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
31668 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
31669 ATTITUDE_QUATERNION_DATA::ID => {
31670 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
31671 }
31672 ATTITUDE_QUATERNION_COV_DATA::ID => {
31673 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
31674 .map(Self::ATTITUDE_QUATERNION_COV)
31675 }
31676 ATTITUDE_TARGET_DATA::ID => {
31677 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
31678 }
31679 ATT_POS_MOCAP_DATA::ID => {
31680 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
31681 }
31682 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
31683 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
31684 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
31685 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
31686 }
31687 AUTOPILOT_VERSION_DATA::ID => {
31688 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
31689 }
31690 AVAILABLE_MODES_DATA::ID => {
31691 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
31692 }
31693 AVAILABLE_MODES_MONITOR_DATA::ID => {
31694 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
31695 .map(Self::AVAILABLE_MODES_MONITOR)
31696 }
31697 BATTERY_INFO_DATA::ID => {
31698 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
31699 }
31700 BATTERY_STATUS_DATA::ID => {
31701 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
31702 }
31703 BUTTON_CHANGE_DATA::ID => {
31704 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
31705 }
31706 CAMERA_CAPTURE_STATUS_DATA::ID => {
31707 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
31708 }
31709 CAMERA_FOV_STATUS_DATA::ID => {
31710 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
31711 }
31712 CAMERA_IMAGE_CAPTURED_DATA::ID => {
31713 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
31714 }
31715 CAMERA_INFORMATION_DATA::ID => {
31716 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
31717 }
31718 CAMERA_SETTINGS_DATA::ID => {
31719 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
31720 }
31721 CAMERA_THERMAL_RANGE_DATA::ID => {
31722 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
31723 }
31724 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
31725 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
31726 .map(Self::CAMERA_TRACKING_GEO_STATUS)
31727 }
31728 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
31729 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
31730 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
31731 }
31732 CAMERA_TRIGGER_DATA::ID => {
31733 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
31734 }
31735 CANFD_FRAME_DATA::ID => {
31736 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
31737 }
31738 CAN_FILTER_MODIFY_DATA::ID => {
31739 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
31740 }
31741 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
31742 CELLULAR_CONFIG_DATA::ID => {
31743 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
31744 }
31745 CELLULAR_STATUS_DATA::ID => {
31746 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
31747 }
31748 CHANGE_OPERATOR_CONTROL_DATA::ID => {
31749 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
31750 .map(Self::CHANGE_OPERATOR_CONTROL)
31751 }
31752 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
31753 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
31754 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
31755 }
31756 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
31757 COMMAND_ACK_DATA::ID => {
31758 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
31759 }
31760 COMMAND_CANCEL_DATA::ID => {
31761 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
31762 }
31763 COMMAND_INT_DATA::ID => {
31764 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
31765 }
31766 COMMAND_LONG_DATA::ID => {
31767 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
31768 }
31769 COMPONENT_INFORMATION_DATA::ID => {
31770 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
31771 }
31772 COMPONENT_INFORMATION_BASIC_DATA::ID => {
31773 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
31774 .map(Self::COMPONENT_INFORMATION_BASIC)
31775 }
31776 COMPONENT_METADATA_DATA::ID => {
31777 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
31778 }
31779 CONTROL_SYSTEM_STATE_DATA::ID => {
31780 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
31781 }
31782 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
31783 .map(Self::CURRENT_EVENT_SEQUENCE),
31784 CURRENT_MODE_DATA::ID => {
31785 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
31786 }
31787 DATA_STREAM_DATA::ID => {
31788 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
31789 }
31790 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
31791 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
31792 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
31793 }
31794 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
31795 DEBUG_FLOAT_ARRAY_DATA::ID => {
31796 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
31797 }
31798 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
31799 DISTANCE_SENSOR_DATA::ID => {
31800 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
31801 }
31802 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
31803 ENCAPSULATED_DATA_DATA::ID => {
31804 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
31805 }
31806 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
31807 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
31808 ESTIMATOR_STATUS_DATA::ID => {
31809 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
31810 }
31811 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
31812 EXTENDED_SYS_STATE_DATA::ID => {
31813 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
31814 }
31815 FENCE_STATUS_DATA::ID => {
31816 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
31817 }
31818 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
31819 .map(Self::FILE_TRANSFER_PROTOCOL),
31820 FLIGHT_INFORMATION_DATA::ID => {
31821 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
31822 }
31823 FOLLOW_TARGET_DATA::ID => {
31824 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
31825 }
31826 FUEL_STATUS_DATA::ID => {
31827 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
31828 }
31829 GENERATOR_STATUS_DATA::ID => {
31830 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
31831 }
31832 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
31833 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
31834 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
31835 }
31836 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
31837 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
31838 .map(Self::GIMBAL_DEVICE_INFORMATION)
31839 }
31840 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
31841 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
31842 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
31843 }
31844 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
31845 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
31846 .map(Self::GIMBAL_MANAGER_INFORMATION)
31847 }
31848 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
31849 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
31850 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
31851 }
31852 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
31853 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
31854 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
31855 }
31856 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
31857 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
31858 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
31859 }
31860 GIMBAL_MANAGER_STATUS_DATA::ID => {
31861 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
31862 }
31863 GLOBAL_POSITION_INT_DATA::ID => {
31864 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
31865 }
31866 GLOBAL_POSITION_INT_COV_DATA::ID => {
31867 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
31868 .map(Self::GLOBAL_POSITION_INT_COV)
31869 }
31870 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
31871 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
31872 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
31873 }
31874 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
31875 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
31876 GPS_GLOBAL_ORIGIN_DATA::ID => {
31877 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
31878 }
31879 GPS_INJECT_DATA_DATA::ID => {
31880 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
31881 }
31882 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
31883 GPS_RAW_INT_DATA::ID => {
31884 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
31885 }
31886 GPS_RTCM_DATA_DATA::ID => {
31887 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
31888 }
31889 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
31890 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
31891 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
31892 HIGHRES_IMU_DATA::ID => {
31893 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
31894 }
31895 HIGH_LATENCY_DATA::ID => {
31896 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
31897 }
31898 HIGH_LATENCY2_DATA::ID => {
31899 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
31900 }
31901 HIL_ACTUATOR_CONTROLS_DATA::ID => {
31902 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
31903 }
31904 HIL_CONTROLS_DATA::ID => {
31905 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
31906 }
31907 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
31908 HIL_OPTICAL_FLOW_DATA::ID => {
31909 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
31910 }
31911 HIL_RC_INPUTS_RAW_DATA::ID => {
31912 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
31913 }
31914 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
31915 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
31916 HIL_STATE_QUATERNION_DATA::ID => {
31917 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
31918 }
31919 HOME_POSITION_DATA::ID => {
31920 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
31921 }
31922 HYGROMETER_SENSOR_DATA::ID => {
31923 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
31924 }
31925 ILLUMINATOR_STATUS_DATA::ID => {
31926 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
31927 }
31928 ISBD_LINK_STATUS_DATA::ID => {
31929 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
31930 }
31931 LANDING_TARGET_DATA::ID => {
31932 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
31933 }
31934 LINK_NODE_STATUS_DATA::ID => {
31935 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
31936 }
31937 LOCAL_POSITION_NED_DATA::ID => {
31938 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
31939 }
31940 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
31941 .map(Self::LOCAL_POSITION_NED_COV),
31942 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
31943 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
31944 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
31945 }
31946 LOGGING_ACK_DATA::ID => {
31947 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
31948 }
31949 LOGGING_DATA_DATA::ID => {
31950 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
31951 }
31952 LOGGING_DATA_ACKED_DATA::ID => {
31953 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
31954 }
31955 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
31956 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
31957 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
31958 LOG_REQUEST_DATA_DATA::ID => {
31959 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
31960 }
31961 LOG_REQUEST_END_DATA::ID => {
31962 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
31963 }
31964 LOG_REQUEST_LIST_DATA::ID => {
31965 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
31966 }
31967 MAG_CAL_REPORT_DATA::ID => {
31968 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
31969 }
31970 MANUAL_CONTROL_DATA::ID => {
31971 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
31972 }
31973 MANUAL_SETPOINT_DATA::ID => {
31974 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
31975 }
31976 MEMORY_VECT_DATA::ID => {
31977 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
31978 }
31979 MESSAGE_INTERVAL_DATA::ID => {
31980 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
31981 }
31982 MISSION_ACK_DATA::ID => {
31983 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
31984 }
31985 MISSION_CLEAR_ALL_DATA::ID => {
31986 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
31987 }
31988 MISSION_COUNT_DATA::ID => {
31989 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
31990 }
31991 MISSION_CURRENT_DATA::ID => {
31992 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
31993 }
31994 MISSION_ITEM_DATA::ID => {
31995 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
31996 }
31997 MISSION_ITEM_INT_DATA::ID => {
31998 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
31999 }
32000 MISSION_ITEM_REACHED_DATA::ID => {
32001 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
32002 }
32003 MISSION_REQUEST_DATA::ID => {
32004 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
32005 }
32006 MISSION_REQUEST_INT_DATA::ID => {
32007 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
32008 }
32009 MISSION_REQUEST_LIST_DATA::ID => {
32010 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
32011 }
32012 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
32013 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
32014 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
32015 }
32016 MISSION_SET_CURRENT_DATA::ID => {
32017 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
32018 }
32019 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
32020 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
32021 .map(Self::MISSION_WRITE_PARTIAL_LIST)
32022 }
32023 MOUNT_ORIENTATION_DATA::ID => {
32024 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
32025 }
32026 NAMED_VALUE_FLOAT_DATA::ID => {
32027 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
32028 }
32029 NAMED_VALUE_INT_DATA::ID => {
32030 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
32031 }
32032 NAV_CONTROLLER_OUTPUT_DATA::ID => {
32033 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
32034 }
32035 OBSTACLE_DISTANCE_DATA::ID => {
32036 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
32037 }
32038 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
32039 ONBOARD_COMPUTER_STATUS_DATA::ID => {
32040 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
32041 .map(Self::ONBOARD_COMPUTER_STATUS)
32042 }
32043 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
32044 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
32045 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
32046 }
32047 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
32048 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
32049 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
32050 }
32051 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
32052 .map(Self::OPEN_DRONE_ID_BASIC_ID),
32053 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
32054 .map(Self::OPEN_DRONE_ID_LOCATION),
32055 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
32056 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
32057 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
32058 }
32059 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
32060 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
32061 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
32062 }
32063 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
32064 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
32065 }
32066 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
32067 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
32068 }
32069 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
32070 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
32071 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
32072 }
32073 OPTICAL_FLOW_DATA::ID => {
32074 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
32075 }
32076 OPTICAL_FLOW_RAD_DATA::ID => {
32077 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
32078 }
32079 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
32080 .map(Self::ORBIT_EXECUTION_STATUS),
32081 PARAM_EXT_ACK_DATA::ID => {
32082 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
32083 }
32084 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
32085 .map(Self::PARAM_EXT_REQUEST_LIST),
32086 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
32087 .map(Self::PARAM_EXT_REQUEST_READ),
32088 PARAM_EXT_SET_DATA::ID => {
32089 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
32090 }
32091 PARAM_EXT_VALUE_DATA::ID => {
32092 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
32093 }
32094 PARAM_MAP_RC_DATA::ID => {
32095 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
32096 }
32097 PARAM_REQUEST_LIST_DATA::ID => {
32098 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
32099 }
32100 PARAM_REQUEST_READ_DATA::ID => {
32101 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
32102 }
32103 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
32104 PARAM_VALUE_DATA::ID => {
32105 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
32106 }
32107 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
32108 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
32109 PLAY_TUNE_V2_DATA::ID => {
32110 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
32111 }
32112 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32113 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32114 .map(Self::POSITION_TARGET_GLOBAL_INT)
32115 }
32116 POSITION_TARGET_LOCAL_NED_DATA::ID => {
32117 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32118 .map(Self::POSITION_TARGET_LOCAL_NED)
32119 }
32120 POWER_STATUS_DATA::ID => {
32121 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
32122 }
32123 PROTOCOL_VERSION_DATA::ID => {
32124 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
32125 }
32126 RADIO_STATUS_DATA::ID => {
32127 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
32128 }
32129 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
32130 RAW_PRESSURE_DATA::ID => {
32131 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
32132 }
32133 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
32134 RC_CHANNELS_DATA::ID => {
32135 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
32136 }
32137 RC_CHANNELS_OVERRIDE_DATA::ID => {
32138 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
32139 }
32140 RC_CHANNELS_RAW_DATA::ID => {
32141 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
32142 }
32143 RC_CHANNELS_SCALED_DATA::ID => {
32144 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
32145 }
32146 REQUEST_DATA_STREAM_DATA::ID => {
32147 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
32148 }
32149 REQUEST_EVENT_DATA::ID => {
32150 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
32151 }
32152 RESOURCE_REQUEST_DATA::ID => {
32153 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
32154 }
32155 RESPONSE_EVENT_ERROR_DATA::ID => {
32156 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
32157 }
32158 SAFETY_ALLOWED_AREA_DATA::ID => {
32159 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
32160 }
32161 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
32162 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
32163 .map(Self::SAFETY_SET_ALLOWED_AREA)
32164 }
32165 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
32166 SCALED_IMU2_DATA::ID => {
32167 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
32168 }
32169 SCALED_IMU3_DATA::ID => {
32170 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
32171 }
32172 SCALED_PRESSURE_DATA::ID => {
32173 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
32174 }
32175 SCALED_PRESSURE2_DATA::ID => {
32176 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
32177 }
32178 SCALED_PRESSURE3_DATA::ID => {
32179 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
32180 }
32181 SCRIPT_COUNT_DATA::ID => {
32182 SCRIPT_COUNT_DATA::deser(version, payload).map(Self::SCRIPT_COUNT)
32183 }
32184 SCRIPT_CURRENT_DATA::ID => {
32185 SCRIPT_CURRENT_DATA::deser(version, payload).map(Self::SCRIPT_CURRENT)
32186 }
32187 SCRIPT_ITEM_DATA::ID => {
32188 SCRIPT_ITEM_DATA::deser(version, payload).map(Self::SCRIPT_ITEM)
32189 }
32190 SCRIPT_REQUEST_DATA::ID => {
32191 SCRIPT_REQUEST_DATA::deser(version, payload).map(Self::SCRIPT_REQUEST)
32192 }
32193 SCRIPT_REQUEST_LIST_DATA::ID => {
32194 SCRIPT_REQUEST_LIST_DATA::deser(version, payload).map(Self::SCRIPT_REQUEST_LIST)
32195 }
32196 SERIAL_CONTROL_DATA::ID => {
32197 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
32198 }
32199 SERVO_OUTPUT_RAW_DATA::ID => {
32200 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
32201 }
32202 SETUP_SIGNING_DATA::ID => {
32203 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
32204 }
32205 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
32206 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32207 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
32208 }
32209 SET_ATTITUDE_TARGET_DATA::ID => {
32210 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
32211 }
32212 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
32213 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
32214 }
32215 SET_HOME_POSITION_DATA::ID => {
32216 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
32217 }
32218 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
32219 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32220 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32221 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
32222 }
32223 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
32224 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32225 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
32226 }
32227 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
32228 SMART_BATTERY_INFO_DATA::ID => {
32229 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
32230 }
32231 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
32232 STORAGE_INFORMATION_DATA::ID => {
32233 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
32234 }
32235 SUPPORTED_TUNES_DATA::ID => {
32236 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
32237 }
32238 SYSTEM_TIME_DATA::ID => {
32239 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
32240 }
32241 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
32242 TERRAIN_CHECK_DATA::ID => {
32243 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
32244 }
32245 TERRAIN_DATA_DATA::ID => {
32246 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
32247 }
32248 TERRAIN_REPORT_DATA::ID => {
32249 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
32250 }
32251 TERRAIN_REQUEST_DATA::ID => {
32252 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
32253 }
32254 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
32255 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
32256 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
32257 .map(Self::TIME_ESTIMATE_TO_TARGET)
32258 }
32259 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
32260 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
32261 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
32262 }
32263 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
32264 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
32265 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
32266 }
32267 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
32268 UAVCAN_NODE_INFO_DATA::ID => {
32269 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
32270 }
32271 UAVCAN_NODE_STATUS_DATA::ID => {
32272 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
32273 }
32274 UTM_GLOBAL_POSITION_DATA::ID => {
32275 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
32276 }
32277 V2_EXTENSION_DATA::ID => {
32278 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
32279 }
32280 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
32281 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
32282 VICON_POSITION_ESTIMATE_DATA::ID => {
32283 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
32284 .map(Self::VICON_POSITION_ESTIMATE)
32285 }
32286 VIDEO_STREAM_INFORMATION_DATA::ID => {
32287 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
32288 .map(Self::VIDEO_STREAM_INFORMATION)
32289 }
32290 VIDEO_STREAM_STATUS_DATA::ID => {
32291 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
32292 }
32293 VISION_POSITION_ESTIMATE_DATA::ID => {
32294 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32295 .map(Self::VISION_POSITION_ESTIMATE)
32296 }
32297 VISION_SPEED_ESTIMATE_DATA::ID => {
32298 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
32299 }
32300 WHEEL_DISTANCE_DATA::ID => {
32301 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
32302 }
32303 WIFI_CONFIG_AP_DATA::ID => {
32304 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
32305 }
32306 WINCH_STATUS_DATA::ID => {
32307 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
32308 }
32309 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
32310 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
32311 }
32312 }
32313 fn message_name(&self) -> &'static str {
32314 match self {
32315 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
32316 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
32317 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
32318 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
32319 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
32320 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
32321 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
32322 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
32323 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
32324 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
32325 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
32326 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32327 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
32328 }
32329 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
32330 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
32331 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
32332 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
32333 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
32334 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
32335 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
32336 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
32337 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
32338 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
32339 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
32340 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
32341 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
32342 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
32343 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
32344 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
32345 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
32346 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
32347 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
32348 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
32349 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
32350 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
32351 Self::COLLISION(..) => COLLISION_DATA::NAME,
32352 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
32353 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
32354 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
32355 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
32356 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
32357 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
32358 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
32359 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
32360 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
32361 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
32362 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
32363 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
32364 Self::DEBUG(..) => DEBUG_DATA::NAME,
32365 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
32366 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
32367 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
32368 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
32369 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
32370 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
32371 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
32372 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
32373 Self::EVENT(..) => EVENT_DATA::NAME,
32374 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
32375 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
32376 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
32377 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
32378 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
32379 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
32380 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
32381 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
32382 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
32383 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
32384 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
32385 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
32386 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32387 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
32388 }
32389 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
32390 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
32391 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
32392 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
32393 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
32394 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
32395 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
32396 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
32397 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
32398 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
32399 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
32400 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
32401 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
32402 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
32403 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
32404 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
32405 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
32406 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
32407 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
32408 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
32409 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
32410 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
32411 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
32412 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
32413 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
32414 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
32415 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
32416 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
32417 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
32418 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
32419 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
32420 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
32421 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
32422 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
32423 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32424 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
32425 }
32426 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
32427 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
32428 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
32429 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
32430 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
32431 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
32432 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
32433 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
32434 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
32435 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
32436 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
32437 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
32438 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
32439 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
32440 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
32441 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
32442 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
32443 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
32444 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
32445 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
32446 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
32447 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
32448 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
32449 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
32450 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
32451 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
32452 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
32453 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
32454 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
32455 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
32456 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
32457 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
32458 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
32459 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
32460 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
32461 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
32462 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
32463 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
32464 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
32465 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
32466 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
32467 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
32468 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
32469 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
32470 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
32471 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
32472 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
32473 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
32474 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
32475 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
32476 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
32477 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
32478 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
32479 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
32480 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
32481 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
32482 Self::PING(..) => PING_DATA::NAME,
32483 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
32484 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
32485 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32486 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
32487 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
32488 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
32489 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
32490 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
32491 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
32492 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
32493 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
32494 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
32495 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
32496 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
32497 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
32498 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
32499 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
32500 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
32501 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
32502 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
32503 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
32504 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
32505 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
32506 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
32507 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
32508 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
32509 Self::SCRIPT_COUNT(..) => SCRIPT_COUNT_DATA::NAME,
32510 Self::SCRIPT_CURRENT(..) => SCRIPT_CURRENT_DATA::NAME,
32511 Self::SCRIPT_ITEM(..) => SCRIPT_ITEM_DATA::NAME,
32512 Self::SCRIPT_REQUEST(..) => SCRIPT_REQUEST_DATA::NAME,
32513 Self::SCRIPT_REQUEST_LIST(..) => SCRIPT_REQUEST_LIST_DATA::NAME,
32514 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
32515 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
32516 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
32517 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
32518 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
32519 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
32520 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
32521 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
32522 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32523 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
32524 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
32525 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
32526 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
32527 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
32528 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
32529 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
32530 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
32531 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
32532 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
32533 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
32534 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
32535 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
32536 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
32537 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
32538 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
32539 }
32540 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
32541 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
32542 }
32543 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
32544 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
32545 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
32546 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
32547 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
32548 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
32549 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
32550 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
32551 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
32552 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
32553 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
32554 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
32555 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
32556 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
32557 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
32558 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
32559 }
32560 }
32561 fn message_id(&self) -> u32 {
32562 match self {
32563 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
32564 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
32565 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
32566 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
32567 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
32568 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
32569 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
32570 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
32571 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
32572 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
32573 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
32574 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32575 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
32576 }
32577 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
32578 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
32579 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
32580 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
32581 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
32582 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
32583 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
32584 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
32585 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
32586 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
32587 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
32588 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
32589 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
32590 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
32591 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
32592 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
32593 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
32594 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
32595 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
32596 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
32597 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
32598 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
32599 Self::COLLISION(..) => COLLISION_DATA::ID,
32600 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
32601 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
32602 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
32603 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
32604 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
32605 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
32606 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
32607 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
32608 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
32609 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
32610 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
32611 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
32612 Self::DEBUG(..) => DEBUG_DATA::ID,
32613 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
32614 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
32615 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
32616 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
32617 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
32618 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
32619 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
32620 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
32621 Self::EVENT(..) => EVENT_DATA::ID,
32622 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
32623 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
32624 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
32625 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
32626 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
32627 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
32628 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
32629 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
32630 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
32631 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
32632 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
32633 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
32634 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32635 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
32636 }
32637 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
32638 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
32639 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
32640 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
32641 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
32642 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
32643 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
32644 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
32645 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
32646 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
32647 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
32648 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
32649 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
32650 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
32651 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
32652 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
32653 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
32654 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
32655 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
32656 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
32657 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
32658 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
32659 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
32660 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
32661 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
32662 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
32663 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
32664 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
32665 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
32666 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
32667 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
32668 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
32669 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
32670 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
32671 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32672 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
32673 }
32674 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
32675 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
32676 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
32677 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
32678 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
32679 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
32680 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
32681 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
32682 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
32683 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
32684 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
32685 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
32686 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
32687 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
32688 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
32689 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
32690 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
32691 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
32692 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
32693 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
32694 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
32695 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
32696 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
32697 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
32698 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
32699 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
32700 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
32701 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
32702 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
32703 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
32704 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
32705 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
32706 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
32707 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
32708 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
32709 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
32710 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
32711 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
32712 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
32713 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
32714 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
32715 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
32716 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
32717 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
32718 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
32719 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
32720 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
32721 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
32722 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
32723 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
32724 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
32725 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
32726 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
32727 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
32728 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
32729 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
32730 Self::PING(..) => PING_DATA::ID,
32731 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
32732 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
32733 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
32734 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
32735 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
32736 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
32737 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
32738 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
32739 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
32740 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
32741 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
32742 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
32743 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
32744 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
32745 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
32746 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
32747 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
32748 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
32749 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
32750 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
32751 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
32752 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
32753 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
32754 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
32755 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
32756 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
32757 Self::SCRIPT_COUNT(..) => SCRIPT_COUNT_DATA::ID,
32758 Self::SCRIPT_CURRENT(..) => SCRIPT_CURRENT_DATA::ID,
32759 Self::SCRIPT_ITEM(..) => SCRIPT_ITEM_DATA::ID,
32760 Self::SCRIPT_REQUEST(..) => SCRIPT_REQUEST_DATA::ID,
32761 Self::SCRIPT_REQUEST_LIST(..) => SCRIPT_REQUEST_LIST_DATA::ID,
32762 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
32763 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
32764 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
32765 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
32766 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
32767 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
32768 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
32769 Self::SET_MODE(..) => SET_MODE_DATA::ID,
32770 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
32771 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
32772 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
32773 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
32774 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
32775 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
32776 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
32777 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
32778 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
32779 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
32780 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
32781 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
32782 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
32783 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
32784 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
32785 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
32786 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
32787 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
32788 }
32789 Self::TUNNEL(..) => TUNNEL_DATA::ID,
32790 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
32791 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
32792 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
32793 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
32794 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
32795 Self::VIBRATION(..) => VIBRATION_DATA::ID,
32796 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
32797 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
32798 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
32799 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
32800 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
32801 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
32802 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
32803 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
32804 Self::WIND_COV(..) => WIND_COV_DATA::ID,
32805 }
32806 }
32807 fn message_id_from_name(name: &str) -> Option<u32> {
32808 match name {
32809 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
32810 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
32811 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
32812 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
32813 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
32814 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
32815 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
32816 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
32817 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
32818 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
32819 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
32820 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
32821 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
32822 }
32823 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
32824 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
32825 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
32826 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
32827 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
32828 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
32829 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
32830 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
32831 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
32832 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
32833 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
32834 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
32835 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
32836 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
32837 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
32838 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
32839 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
32840 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
32841 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
32842 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
32843 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
32844 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
32845 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
32846 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
32847 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
32848 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
32849 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
32850 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
32851 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
32852 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
32853 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
32854 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
32855 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
32856 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
32857 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
32858 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
32859 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
32860 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
32861 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
32862 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
32863 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
32864 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
32865 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
32866 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
32867 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
32868 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
32869 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
32870 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
32871 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
32872 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
32873 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
32874 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
32875 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
32876 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
32877 }
32878 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
32879 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
32880 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
32881 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
32882 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
32883 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
32884 }
32885 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
32886 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
32887 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
32888 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
32889 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
32890 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
32891 }
32892 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
32893 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
32894 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
32895 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
32896 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
32897 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
32898 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
32899 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
32900 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
32901 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
32902 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
32903 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
32904 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
32905 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
32906 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
32907 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
32908 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
32909 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
32910 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
32911 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
32912 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
32913 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
32914 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
32915 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
32916 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
32917 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
32918 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
32919 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
32920 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
32921 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
32922 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
32923 }
32924 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
32925 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
32926 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
32927 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
32928 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
32929 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
32930 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
32931 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
32932 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
32933 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
32934 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
32935 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
32936 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
32937 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
32938 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
32939 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
32940 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
32941 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
32942 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
32943 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
32944 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
32945 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
32946 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
32947 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
32948 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
32949 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
32950 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
32951 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
32952 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
32953 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
32954 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
32955 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
32956 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
32957 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
32958 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
32959 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
32960 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
32961 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
32962 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
32963 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
32964 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
32965 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
32966 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
32967 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
32968 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
32969 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
32970 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
32971 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
32972 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
32973 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
32974 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
32975 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
32976 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
32977 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
32978 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
32979 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
32980 PING_DATA::NAME => Some(PING_DATA::ID),
32981 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
32982 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
32983 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
32984 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
32985 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
32986 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
32987 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
32988 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
32989 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
32990 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
32991 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
32992 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
32993 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
32994 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
32995 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
32996 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
32997 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
32998 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
32999 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
33000 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
33001 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
33002 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
33003 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
33004 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
33005 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
33006 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
33007 SCRIPT_COUNT_DATA::NAME => Some(SCRIPT_COUNT_DATA::ID),
33008 SCRIPT_CURRENT_DATA::NAME => Some(SCRIPT_CURRENT_DATA::ID),
33009 SCRIPT_ITEM_DATA::NAME => Some(SCRIPT_ITEM_DATA::ID),
33010 SCRIPT_REQUEST_DATA::NAME => Some(SCRIPT_REQUEST_DATA::ID),
33011 SCRIPT_REQUEST_LIST_DATA::NAME => Some(SCRIPT_REQUEST_LIST_DATA::ID),
33012 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
33013 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
33014 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
33015 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
33016 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
33017 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
33018 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
33019 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
33020 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
33021 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
33022 }
33023 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
33024 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
33025 }
33026 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
33027 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
33028 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
33029 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
33030 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
33031 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
33032 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
33033 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
33034 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
33035 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
33036 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
33037 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
33038 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
33039 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
33040 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
33041 }
33042 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
33043 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
33044 }
33045 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
33046 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
33047 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
33048 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
33049 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
33050 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
33051 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
33052 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
33053 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
33054 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
33055 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
33056 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
33057 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
33058 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
33059 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
33060 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
33061 _ => None,
33062 }
33063 }
33064 fn default_message_from_id(id: u32) -> Option<Self> {
33065 match id {
33066 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33067 ACTUATOR_CONTROL_TARGET_DATA::default(),
33068 )),
33069 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33070 ACTUATOR_OUTPUT_STATUS_DATA::default(),
33071 )),
33072 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
33073 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
33074 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
33075 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
33076 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33077 ATTITUDE_QUATERNION_DATA::default(),
33078 )),
33079 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33080 ATTITUDE_QUATERNION_COV_DATA::default(),
33081 )),
33082 ATTITUDE_TARGET_DATA::ID => {
33083 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
33084 }
33085 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
33086 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
33087 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33088 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33089 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
33090 ))
33091 }
33092 AUTOPILOT_VERSION_DATA::ID => {
33093 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
33094 }
33095 AVAILABLE_MODES_DATA::ID => {
33096 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
33097 }
33098 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33099 AVAILABLE_MODES_MONITOR_DATA::default(),
33100 )),
33101 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
33102 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
33103 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
33104 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33105 CAMERA_CAPTURE_STATUS_DATA::default(),
33106 )),
33107 CAMERA_FOV_STATUS_DATA::ID => {
33108 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
33109 }
33110 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33111 CAMERA_IMAGE_CAPTURED_DATA::default(),
33112 )),
33113 CAMERA_INFORMATION_DATA::ID => {
33114 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
33115 }
33116 CAMERA_SETTINGS_DATA::ID => {
33117 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
33118 }
33119 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33120 CAMERA_THERMAL_RANGE_DATA::default(),
33121 )),
33122 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33123 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
33124 )),
33125 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33126 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
33127 )),
33128 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
33129 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
33130 CAN_FILTER_MODIFY_DATA::ID => {
33131 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
33132 }
33133 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
33134 CELLULAR_CONFIG_DATA::ID => {
33135 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
33136 }
33137 CELLULAR_STATUS_DATA::ID => {
33138 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
33139 }
33140 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33141 CHANGE_OPERATOR_CONTROL_DATA::default(),
33142 )),
33143 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33144 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
33145 )),
33146 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
33147 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
33148 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
33149 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
33150 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
33151 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33152 COMPONENT_INFORMATION_DATA::default(),
33153 )),
33154 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33155 COMPONENT_INFORMATION_BASIC_DATA::default(),
33156 )),
33157 COMPONENT_METADATA_DATA::ID => {
33158 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
33159 }
33160 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33161 CONTROL_SYSTEM_STATE_DATA::default(),
33162 )),
33163 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33164 CURRENT_EVENT_SEQUENCE_DATA::default(),
33165 )),
33166 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
33167 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
33168 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33169 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
33170 )),
33171 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
33172 DEBUG_FLOAT_ARRAY_DATA::ID => {
33173 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
33174 }
33175 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
33176 DISTANCE_SENSOR_DATA::ID => {
33177 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
33178 }
33179 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
33180 ENCAPSULATED_DATA_DATA::ID => {
33181 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
33182 }
33183 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
33184 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
33185 ESTIMATOR_STATUS_DATA::ID => {
33186 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
33187 }
33188 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
33189 EXTENDED_SYS_STATE_DATA::ID => {
33190 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
33191 }
33192 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
33193 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33194 FILE_TRANSFER_PROTOCOL_DATA::default(),
33195 )),
33196 FLIGHT_INFORMATION_DATA::ID => {
33197 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
33198 }
33199 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
33200 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
33201 GENERATOR_STATUS_DATA::ID => {
33202 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
33203 }
33204 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33205 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
33206 )),
33207 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33208 GIMBAL_DEVICE_INFORMATION_DATA::default(),
33209 )),
33210 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33211 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
33212 )),
33213 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33214 GIMBAL_MANAGER_INFORMATION_DATA::default(),
33215 )),
33216 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33217 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
33218 )),
33219 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33220 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33221 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
33222 ))
33223 }
33224 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33225 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
33226 )),
33227 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33228 GIMBAL_MANAGER_STATUS_DATA::default(),
33229 )),
33230 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33231 GLOBAL_POSITION_INT_DATA::default(),
33232 )),
33233 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33234 GLOBAL_POSITION_INT_COV_DATA::default(),
33235 )),
33236 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33237 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33238 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
33239 ))
33240 }
33241 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
33242 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
33243 GPS_GLOBAL_ORIGIN_DATA::ID => {
33244 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
33245 }
33246 GPS_INJECT_DATA_DATA::ID => {
33247 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
33248 }
33249 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
33250 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
33251 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
33252 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
33253 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
33254 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
33255 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
33256 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
33257 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
33258 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33259 HIL_ACTUATOR_CONTROLS_DATA::default(),
33260 )),
33261 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
33262 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
33263 HIL_OPTICAL_FLOW_DATA::ID => {
33264 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
33265 }
33266 HIL_RC_INPUTS_RAW_DATA::ID => {
33267 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
33268 }
33269 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
33270 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
33271 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33272 HIL_STATE_QUATERNION_DATA::default(),
33273 )),
33274 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
33275 HYGROMETER_SENSOR_DATA::ID => {
33276 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
33277 }
33278 ILLUMINATOR_STATUS_DATA::ID => {
33279 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
33280 }
33281 ISBD_LINK_STATUS_DATA::ID => {
33282 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
33283 }
33284 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
33285 LINK_NODE_STATUS_DATA::ID => {
33286 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
33287 }
33288 LOCAL_POSITION_NED_DATA::ID => {
33289 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
33290 }
33291 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33292 LOCAL_POSITION_NED_COV_DATA::default(),
33293 )),
33294 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33295 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33296 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
33297 ))
33298 }
33299 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
33300 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
33301 LOGGING_DATA_ACKED_DATA::ID => {
33302 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
33303 }
33304 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
33305 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
33306 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
33307 LOG_REQUEST_DATA_DATA::ID => {
33308 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
33309 }
33310 LOG_REQUEST_END_DATA::ID => {
33311 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
33312 }
33313 LOG_REQUEST_LIST_DATA::ID => {
33314 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
33315 }
33316 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
33317 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
33318 MANUAL_SETPOINT_DATA::ID => {
33319 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
33320 }
33321 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
33322 MESSAGE_INTERVAL_DATA::ID => {
33323 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
33324 }
33325 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
33326 MISSION_CLEAR_ALL_DATA::ID => {
33327 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
33328 }
33329 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
33330 MISSION_CURRENT_DATA::ID => {
33331 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
33332 }
33333 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
33334 MISSION_ITEM_INT_DATA::ID => {
33335 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
33336 }
33337 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33338 MISSION_ITEM_REACHED_DATA::default(),
33339 )),
33340 MISSION_REQUEST_DATA::ID => {
33341 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
33342 }
33343 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33344 MISSION_REQUEST_INT_DATA::default(),
33345 )),
33346 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
33347 MISSION_REQUEST_LIST_DATA::default(),
33348 )),
33349 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33350 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
33351 )),
33352 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33353 MISSION_SET_CURRENT_DATA::default(),
33354 )),
33355 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33356 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
33357 )),
33358 MOUNT_ORIENTATION_DATA::ID => {
33359 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
33360 }
33361 NAMED_VALUE_FLOAT_DATA::ID => {
33362 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
33363 }
33364 NAMED_VALUE_INT_DATA::ID => {
33365 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
33366 }
33367 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
33368 NAV_CONTROLLER_OUTPUT_DATA::default(),
33369 )),
33370 OBSTACLE_DISTANCE_DATA::ID => {
33371 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
33372 }
33373 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
33374 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
33375 ONBOARD_COMPUTER_STATUS_DATA::default(),
33376 )),
33377 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
33378 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
33379 )),
33380 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
33381 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
33382 )),
33383 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
33384 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
33385 )),
33386 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
33387 OPEN_DRONE_ID_LOCATION_DATA::default(),
33388 )),
33389 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
33390 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
33391 )),
33392 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
33393 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
33394 )),
33395 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
33396 OPEN_DRONE_ID_SELF_ID_DATA::default(),
33397 )),
33398 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
33399 OPEN_DRONE_ID_SYSTEM_DATA::default(),
33400 )),
33401 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
33402 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
33403 )),
33404 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
33405 OPTICAL_FLOW_RAD_DATA::ID => {
33406 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
33407 }
33408 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
33409 ORBIT_EXECUTION_STATUS_DATA::default(),
33410 )),
33411 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
33412 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
33413 PARAM_EXT_REQUEST_LIST_DATA::default(),
33414 )),
33415 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
33416 PARAM_EXT_REQUEST_READ_DATA::default(),
33417 )),
33418 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
33419 PARAM_EXT_VALUE_DATA::ID => {
33420 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
33421 }
33422 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
33423 PARAM_REQUEST_LIST_DATA::ID => {
33424 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
33425 }
33426 PARAM_REQUEST_READ_DATA::ID => {
33427 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
33428 }
33429 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
33430 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
33431 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
33432 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
33433 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
33434 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
33435 POSITION_TARGET_GLOBAL_INT_DATA::default(),
33436 )),
33437 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
33438 POSITION_TARGET_LOCAL_NED_DATA::default(),
33439 )),
33440 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
33441 PROTOCOL_VERSION_DATA::ID => {
33442 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
33443 }
33444 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
33445 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
33446 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
33447 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
33448 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
33449 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
33450 RC_CHANNELS_OVERRIDE_DATA::default(),
33451 )),
33452 RC_CHANNELS_RAW_DATA::ID => {
33453 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
33454 }
33455 RC_CHANNELS_SCALED_DATA::ID => {
33456 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
33457 }
33458 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
33459 REQUEST_DATA_STREAM_DATA::default(),
33460 )),
33461 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
33462 RESOURCE_REQUEST_DATA::ID => {
33463 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
33464 }
33465 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
33466 RESPONSE_EVENT_ERROR_DATA::default(),
33467 )),
33468 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
33469 SAFETY_ALLOWED_AREA_DATA::default(),
33470 )),
33471 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
33472 SAFETY_SET_ALLOWED_AREA_DATA::default(),
33473 )),
33474 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
33475 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
33476 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
33477 SCALED_PRESSURE_DATA::ID => {
33478 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
33479 }
33480 SCALED_PRESSURE2_DATA::ID => {
33481 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
33482 }
33483 SCALED_PRESSURE3_DATA::ID => {
33484 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
33485 }
33486 SCRIPT_COUNT_DATA::ID => Some(Self::SCRIPT_COUNT(SCRIPT_COUNT_DATA::default())),
33487 SCRIPT_CURRENT_DATA::ID => Some(Self::SCRIPT_CURRENT(SCRIPT_CURRENT_DATA::default())),
33488 SCRIPT_ITEM_DATA::ID => Some(Self::SCRIPT_ITEM(SCRIPT_ITEM_DATA::default())),
33489 SCRIPT_REQUEST_DATA::ID => Some(Self::SCRIPT_REQUEST(SCRIPT_REQUEST_DATA::default())),
33490 SCRIPT_REQUEST_LIST_DATA::ID => Some(Self::SCRIPT_REQUEST_LIST(
33491 SCRIPT_REQUEST_LIST_DATA::default(),
33492 )),
33493 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
33494 SERVO_OUTPUT_RAW_DATA::ID => {
33495 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
33496 }
33497 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
33498 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
33499 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
33500 )),
33501 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
33502 SET_ATTITUDE_TARGET_DATA::default(),
33503 )),
33504 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
33505 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
33506 )),
33507 SET_HOME_POSITION_DATA::ID => {
33508 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
33509 }
33510 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
33511 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
33512 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
33513 )),
33514 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
33515 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
33516 )),
33517 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
33518 SMART_BATTERY_INFO_DATA::ID => {
33519 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
33520 }
33521 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
33522 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
33523 STORAGE_INFORMATION_DATA::default(),
33524 )),
33525 SUPPORTED_TUNES_DATA::ID => {
33526 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
33527 }
33528 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
33529 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
33530 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
33531 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
33532 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
33533 TERRAIN_REQUEST_DATA::ID => {
33534 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
33535 }
33536 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
33537 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
33538 TIME_ESTIMATE_TO_TARGET_DATA::default(),
33539 )),
33540 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33541 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
33542 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
33543 ))
33544 }
33545 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33546 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
33547 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
33548 ))
33549 }
33550 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
33551 UAVCAN_NODE_INFO_DATA::ID => {
33552 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
33553 }
33554 UAVCAN_NODE_STATUS_DATA::ID => {
33555 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
33556 }
33557 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
33558 UTM_GLOBAL_POSITION_DATA::default(),
33559 )),
33560 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
33561 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
33562 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
33563 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
33564 VICON_POSITION_ESTIMATE_DATA::default(),
33565 )),
33566 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
33567 VIDEO_STREAM_INFORMATION_DATA::default(),
33568 )),
33569 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
33570 VIDEO_STREAM_STATUS_DATA::default(),
33571 )),
33572 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
33573 VISION_POSITION_ESTIMATE_DATA::default(),
33574 )),
33575 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
33576 VISION_SPEED_ESTIMATE_DATA::default(),
33577 )),
33578 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
33579 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
33580 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
33581 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
33582 _ => None,
33583 }
33584 }
33585 #[cfg(feature = "arbitrary")]
33586 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
33587 match id {
33588 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33589 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
33590 )),
33591 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33592 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
33593 )),
33594 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
33595 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
33596 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
33597 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
33598 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33599 ATTITUDE_QUATERNION_DATA::random(rng),
33600 )),
33601 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33602 ATTITUDE_QUATERNION_COV_DATA::random(rng),
33603 )),
33604 ATTITUDE_TARGET_DATA::ID => {
33605 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
33606 }
33607 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
33608 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
33609 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33610 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33611 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
33612 ))
33613 }
33614 AUTOPILOT_VERSION_DATA::ID => {
33615 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
33616 }
33617 AVAILABLE_MODES_DATA::ID => {
33618 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
33619 }
33620 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33621 AVAILABLE_MODES_MONITOR_DATA::random(rng),
33622 )),
33623 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
33624 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
33625 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
33626 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33627 CAMERA_CAPTURE_STATUS_DATA::random(rng),
33628 )),
33629 CAMERA_FOV_STATUS_DATA::ID => {
33630 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
33631 }
33632 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33633 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
33634 )),
33635 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
33636 CAMERA_INFORMATION_DATA::random(rng),
33637 )),
33638 CAMERA_SETTINGS_DATA::ID => {
33639 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
33640 }
33641 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33642 CAMERA_THERMAL_RANGE_DATA::random(rng),
33643 )),
33644 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33645 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
33646 )),
33647 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33648 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
33649 )),
33650 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
33651 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
33652 CAN_FILTER_MODIFY_DATA::ID => {
33653 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
33654 }
33655 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
33656 CELLULAR_CONFIG_DATA::ID => {
33657 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
33658 }
33659 CELLULAR_STATUS_DATA::ID => {
33660 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
33661 }
33662 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33663 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
33664 )),
33665 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33666 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
33667 )),
33668 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
33669 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
33670 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
33671 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
33672 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
33673 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33674 COMPONENT_INFORMATION_DATA::random(rng),
33675 )),
33676 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33677 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
33678 )),
33679 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
33680 COMPONENT_METADATA_DATA::random(rng),
33681 )),
33682 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33683 CONTROL_SYSTEM_STATE_DATA::random(rng),
33684 )),
33685 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33686 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
33687 )),
33688 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
33689 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
33690 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33691 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
33692 )),
33693 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
33694 DEBUG_FLOAT_ARRAY_DATA::ID => {
33695 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
33696 }
33697 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
33698 DISTANCE_SENSOR_DATA::ID => {
33699 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
33700 }
33701 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
33702 ENCAPSULATED_DATA_DATA::ID => {
33703 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
33704 }
33705 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
33706 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
33707 ESTIMATOR_STATUS_DATA::ID => {
33708 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
33709 }
33710 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
33711 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
33712 EXTENDED_SYS_STATE_DATA::random(rng),
33713 )),
33714 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
33715 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33716 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
33717 )),
33718 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
33719 FLIGHT_INFORMATION_DATA::random(rng),
33720 )),
33721 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
33722 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
33723 GENERATOR_STATUS_DATA::ID => {
33724 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
33725 }
33726 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33727 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
33728 )),
33729 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33730 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
33731 )),
33732 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33733 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
33734 )),
33735 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33736 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
33737 )),
33738 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33739 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
33740 )),
33741 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33742 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33743 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
33744 ))
33745 }
33746 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33747 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
33748 )),
33749 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33750 GIMBAL_MANAGER_STATUS_DATA::random(rng),
33751 )),
33752 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33753 GLOBAL_POSITION_INT_DATA::random(rng),
33754 )),
33755 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33756 GLOBAL_POSITION_INT_COV_DATA::random(rng),
33757 )),
33758 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33759 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33760 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
33761 ))
33762 }
33763 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
33764 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
33765 GPS_GLOBAL_ORIGIN_DATA::ID => {
33766 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
33767 }
33768 GPS_INJECT_DATA_DATA::ID => {
33769 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
33770 }
33771 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
33772 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
33773 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
33774 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
33775 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
33776 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
33777 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
33778 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
33779 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
33780 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33781 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
33782 )),
33783 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
33784 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
33785 HIL_OPTICAL_FLOW_DATA::ID => {
33786 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
33787 }
33788 HIL_RC_INPUTS_RAW_DATA::ID => {
33789 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
33790 }
33791 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
33792 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
33793 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33794 HIL_STATE_QUATERNION_DATA::random(rng),
33795 )),
33796 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
33797 HYGROMETER_SENSOR_DATA::ID => {
33798 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
33799 }
33800 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
33801 ILLUMINATOR_STATUS_DATA::random(rng),
33802 )),
33803 ISBD_LINK_STATUS_DATA::ID => {
33804 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
33805 }
33806 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
33807 LINK_NODE_STATUS_DATA::ID => {
33808 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
33809 }
33810 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
33811 LOCAL_POSITION_NED_DATA::random(rng),
33812 )),
33813 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33814 LOCAL_POSITION_NED_COV_DATA::random(rng),
33815 )),
33816 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33817 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33818 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
33819 ))
33820 }
33821 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
33822 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
33823 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
33824 LOGGING_DATA_ACKED_DATA::random(rng),
33825 )),
33826 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
33827 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
33828 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
33829 LOG_REQUEST_DATA_DATA::ID => {
33830 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
33831 }
33832 LOG_REQUEST_END_DATA::ID => {
33833 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
33834 }
33835 LOG_REQUEST_LIST_DATA::ID => {
33836 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
33837 }
33838 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
33839 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
33840 MANUAL_SETPOINT_DATA::ID => {
33841 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
33842 }
33843 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
33844 MESSAGE_INTERVAL_DATA::ID => {
33845 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
33846 }
33847 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
33848 MISSION_CLEAR_ALL_DATA::ID => {
33849 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
33850 }
33851 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
33852 MISSION_CURRENT_DATA::ID => {
33853 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
33854 }
33855 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
33856 MISSION_ITEM_INT_DATA::ID => {
33857 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
33858 }
33859 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33860 MISSION_ITEM_REACHED_DATA::random(rng),
33861 )),
33862 MISSION_REQUEST_DATA::ID => {
33863 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
33864 }
33865 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33866 MISSION_REQUEST_INT_DATA::random(rng),
33867 )),
33868 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
33869 MISSION_REQUEST_LIST_DATA::random(rng),
33870 )),
33871 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33872 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
33873 )),
33874 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33875 MISSION_SET_CURRENT_DATA::random(rng),
33876 )),
33877 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33878 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
33879 )),
33880 MOUNT_ORIENTATION_DATA::ID => {
33881 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
33882 }
33883 NAMED_VALUE_FLOAT_DATA::ID => {
33884 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
33885 }
33886 NAMED_VALUE_INT_DATA::ID => {
33887 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
33888 }
33889 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
33890 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
33891 )),
33892 OBSTACLE_DISTANCE_DATA::ID => {
33893 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
33894 }
33895 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
33896 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
33897 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
33898 )),
33899 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
33900 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
33901 )),
33902 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
33903 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
33904 )),
33905 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
33906 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
33907 )),
33908 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
33909 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
33910 )),
33911 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
33912 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
33913 )),
33914 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
33915 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
33916 )),
33917 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
33918 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
33919 )),
33920 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
33921 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
33922 )),
33923 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
33924 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
33925 )),
33926 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
33927 OPTICAL_FLOW_RAD_DATA::ID => {
33928 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
33929 }
33930 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
33931 ORBIT_EXECUTION_STATUS_DATA::random(rng),
33932 )),
33933 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
33934 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
33935 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
33936 )),
33937 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
33938 PARAM_EXT_REQUEST_READ_DATA::random(rng),
33939 )),
33940 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
33941 PARAM_EXT_VALUE_DATA::ID => {
33942 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
33943 }
33944 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
33945 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
33946 PARAM_REQUEST_LIST_DATA::random(rng),
33947 )),
33948 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
33949 PARAM_REQUEST_READ_DATA::random(rng),
33950 )),
33951 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
33952 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
33953 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
33954 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
33955 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
33956 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
33957 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
33958 )),
33959 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
33960 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
33961 )),
33962 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
33963 PROTOCOL_VERSION_DATA::ID => {
33964 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
33965 }
33966 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
33967 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
33968 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
33969 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
33970 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
33971 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
33972 RC_CHANNELS_OVERRIDE_DATA::random(rng),
33973 )),
33974 RC_CHANNELS_RAW_DATA::ID => {
33975 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
33976 }
33977 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
33978 RC_CHANNELS_SCALED_DATA::random(rng),
33979 )),
33980 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
33981 REQUEST_DATA_STREAM_DATA::random(rng),
33982 )),
33983 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
33984 RESOURCE_REQUEST_DATA::ID => {
33985 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
33986 }
33987 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
33988 RESPONSE_EVENT_ERROR_DATA::random(rng),
33989 )),
33990 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
33991 SAFETY_ALLOWED_AREA_DATA::random(rng),
33992 )),
33993 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
33994 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
33995 )),
33996 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
33997 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
33998 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
33999 SCALED_PRESSURE_DATA::ID => {
34000 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
34001 }
34002 SCALED_PRESSURE2_DATA::ID => {
34003 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
34004 }
34005 SCALED_PRESSURE3_DATA::ID => {
34006 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
34007 }
34008 SCRIPT_COUNT_DATA::ID => Some(Self::SCRIPT_COUNT(SCRIPT_COUNT_DATA::random(rng))),
34009 SCRIPT_CURRENT_DATA::ID => Some(Self::SCRIPT_CURRENT(SCRIPT_CURRENT_DATA::random(rng))),
34010 SCRIPT_ITEM_DATA::ID => Some(Self::SCRIPT_ITEM(SCRIPT_ITEM_DATA::random(rng))),
34011 SCRIPT_REQUEST_DATA::ID => Some(Self::SCRIPT_REQUEST(SCRIPT_REQUEST_DATA::random(rng))),
34012 SCRIPT_REQUEST_LIST_DATA::ID => Some(Self::SCRIPT_REQUEST_LIST(
34013 SCRIPT_REQUEST_LIST_DATA::random(rng),
34014 )),
34015 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
34016 SERVO_OUTPUT_RAW_DATA::ID => {
34017 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
34018 }
34019 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
34020 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34021 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34022 )),
34023 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34024 SET_ATTITUDE_TARGET_DATA::random(rng),
34025 )),
34026 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34027 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
34028 )),
34029 SET_HOME_POSITION_DATA::ID => {
34030 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
34031 }
34032 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
34033 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34034 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34035 )),
34036 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34037 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34038 )),
34039 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
34040 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
34041 SMART_BATTERY_INFO_DATA::random(rng),
34042 )),
34043 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
34044 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34045 STORAGE_INFORMATION_DATA::random(rng),
34046 )),
34047 SUPPORTED_TUNES_DATA::ID => {
34048 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
34049 }
34050 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
34051 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
34052 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
34053 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
34054 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
34055 TERRAIN_REQUEST_DATA::ID => {
34056 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
34057 }
34058 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
34059 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34060 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
34061 )),
34062 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34063 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34064 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
34065 ))
34066 }
34067 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34068 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34069 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
34070 ))
34071 }
34072 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
34073 UAVCAN_NODE_INFO_DATA::ID => {
34074 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
34075 }
34076 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
34077 UAVCAN_NODE_STATUS_DATA::random(rng),
34078 )),
34079 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34080 UTM_GLOBAL_POSITION_DATA::random(rng),
34081 )),
34082 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
34083 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
34084 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
34085 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34086 VICON_POSITION_ESTIMATE_DATA::random(rng),
34087 )),
34088 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34089 VIDEO_STREAM_INFORMATION_DATA::random(rng),
34090 )),
34091 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34092 VIDEO_STREAM_STATUS_DATA::random(rng),
34093 )),
34094 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34095 VISION_POSITION_ESTIMATE_DATA::random(rng),
34096 )),
34097 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34098 VISION_SPEED_ESTIMATE_DATA::random(rng),
34099 )),
34100 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
34101 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
34102 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
34103 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
34104 _ => None,
34105 }
34106 }
34107 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34108 match self {
34109 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34110 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
34111 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
34112 Self::AIS_VESSEL(body) => body.ser(version, bytes),
34113 Self::ALTITUDE(body) => body.ser(version, bytes),
34114 Self::ATTITUDE(body) => body.ser(version, bytes),
34115 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
34116 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
34117 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
34118 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
34119 Self::AUTH_KEY(body) => body.ser(version, bytes),
34120 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
34121 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
34122 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
34123 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
34124 Self::BATTERY_INFO(body) => body.ser(version, bytes),
34125 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
34126 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
34127 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
34128 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
34129 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
34130 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
34131 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
34132 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
34133 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
34134 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
34135 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
34136 Self::CANFD_FRAME(body) => body.ser(version, bytes),
34137 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
34138 Self::CAN_FRAME(body) => body.ser(version, bytes),
34139 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
34140 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
34141 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
34142 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
34143 Self::COLLISION(body) => body.ser(version, bytes),
34144 Self::COMMAND_ACK(body) => body.ser(version, bytes),
34145 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
34146 Self::COMMAND_INT(body) => body.ser(version, bytes),
34147 Self::COMMAND_LONG(body) => body.ser(version, bytes),
34148 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
34149 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
34150 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
34151 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
34152 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
34153 Self::CURRENT_MODE(body) => body.ser(version, bytes),
34154 Self::DATA_STREAM(body) => body.ser(version, bytes),
34155 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
34156 Self::DEBUG(body) => body.ser(version, bytes),
34157 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
34158 Self::DEBUG_VECT(body) => body.ser(version, bytes),
34159 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
34160 Self::EFI_STATUS(body) => body.ser(version, bytes),
34161 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
34162 Self::ESC_INFO(body) => body.ser(version, bytes),
34163 Self::ESC_STATUS(body) => body.ser(version, bytes),
34164 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
34165 Self::EVENT(body) => body.ser(version, bytes),
34166 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
34167 Self::FENCE_STATUS(body) => body.ser(version, bytes),
34168 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
34169 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
34170 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
34171 Self::FUEL_STATUS(body) => body.ser(version, bytes),
34172 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
34173 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
34174 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
34175 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
34176 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
34177 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
34178 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
34179 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
34180 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
34181 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
34182 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
34183 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34184 Self::GPS2_RAW(body) => body.ser(version, bytes),
34185 Self::GPS2_RTK(body) => body.ser(version, bytes),
34186 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34187 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
34188 Self::GPS_INPUT(body) => body.ser(version, bytes),
34189 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
34190 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
34191 Self::GPS_RTK(body) => body.ser(version, bytes),
34192 Self::GPS_STATUS(body) => body.ser(version, bytes),
34193 Self::HEARTBEAT(body) => body.ser(version, bytes),
34194 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
34195 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
34196 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
34197 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
34198 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
34199 Self::HIL_GPS(body) => body.ser(version, bytes),
34200 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
34201 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
34202 Self::HIL_SENSOR(body) => body.ser(version, bytes),
34203 Self::HIL_STATE(body) => body.ser(version, bytes),
34204 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
34205 Self::HOME_POSITION(body) => body.ser(version, bytes),
34206 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
34207 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
34208 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
34209 Self::LANDING_TARGET(body) => body.ser(version, bytes),
34210 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
34211 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
34212 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
34213 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
34214 Self::LOGGING_ACK(body) => body.ser(version, bytes),
34215 Self::LOGGING_DATA(body) => body.ser(version, bytes),
34216 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
34217 Self::LOG_DATA(body) => body.ser(version, bytes),
34218 Self::LOG_ENTRY(body) => body.ser(version, bytes),
34219 Self::LOG_ERASE(body) => body.ser(version, bytes),
34220 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
34221 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
34222 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
34223 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
34224 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
34225 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
34226 Self::MEMORY_VECT(body) => body.ser(version, bytes),
34227 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
34228 Self::MISSION_ACK(body) => body.ser(version, bytes),
34229 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
34230 Self::MISSION_COUNT(body) => body.ser(version, bytes),
34231 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
34232 Self::MISSION_ITEM(body) => body.ser(version, bytes),
34233 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
34234 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
34235 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
34236 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
34237 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
34238 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
34239 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
34240 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
34241 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
34242 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
34243 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
34244 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
34245 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
34246 Self::ODOMETRY(body) => body.ser(version, bytes),
34247 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
34248 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
34249 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
34250 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
34251 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
34252 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
34253 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
34254 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
34255 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
34256 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
34257 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
34258 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
34259 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
34260 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
34261 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
34262 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
34263 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
34264 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
34265 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
34266 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
34267 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
34268 Self::PARAM_SET(body) => body.ser(version, bytes),
34269 Self::PARAM_VALUE(body) => body.ser(version, bytes),
34270 Self::PING(body) => body.ser(version, bytes),
34271 Self::PLAY_TUNE(body) => body.ser(version, bytes),
34272 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
34273 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34274 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34275 Self::POWER_STATUS(body) => body.ser(version, bytes),
34276 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
34277 Self::RADIO_STATUS(body) => body.ser(version, bytes),
34278 Self::RAW_IMU(body) => body.ser(version, bytes),
34279 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
34280 Self::RAW_RPM(body) => body.ser(version, bytes),
34281 Self::RC_CHANNELS(body) => body.ser(version, bytes),
34282 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
34283 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
34284 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
34285 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
34286 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
34287 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
34288 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
34289 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
34290 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
34291 Self::SCALED_IMU(body) => body.ser(version, bytes),
34292 Self::SCALED_IMU2(body) => body.ser(version, bytes),
34293 Self::SCALED_IMU3(body) => body.ser(version, bytes),
34294 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
34295 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
34296 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
34297 Self::SCRIPT_COUNT(body) => body.ser(version, bytes),
34298 Self::SCRIPT_CURRENT(body) => body.ser(version, bytes),
34299 Self::SCRIPT_ITEM(body) => body.ser(version, bytes),
34300 Self::SCRIPT_REQUEST(body) => body.ser(version, bytes),
34301 Self::SCRIPT_REQUEST_LIST(body) => body.ser(version, bytes),
34302 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
34303 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
34304 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
34305 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34306 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
34307 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34308 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
34309 Self::SET_MODE(body) => body.ser(version, bytes),
34310 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34311 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34312 Self::SIM_STATE(body) => body.ser(version, bytes),
34313 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
34314 Self::STATUSTEXT(body) => body.ser(version, bytes),
34315 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
34316 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
34317 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
34318 Self::SYS_STATUS(body) => body.ser(version, bytes),
34319 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
34320 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
34321 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
34322 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
34323 Self::TIMESYNC(body) => body.ser(version, bytes),
34324 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
34325 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
34326 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
34327 Self::TUNNEL(body) => body.ser(version, bytes),
34328 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
34329 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
34330 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
34331 Self::V2_EXTENSION(body) => body.ser(version, bytes),
34332 Self::VFR_HUD(body) => body.ser(version, bytes),
34333 Self::VIBRATION(body) => body.ser(version, bytes),
34334 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34335 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
34336 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
34337 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34338 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
34339 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
34340 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
34341 Self::WINCH_STATUS(body) => body.ser(version, bytes),
34342 Self::WIND_COV(body) => body.ser(version, bytes),
34343 }
34344 }
34345 fn extra_crc(id: u32) -> u8 {
34346 match id {
34347 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34348 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
34349 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
34350 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
34351 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
34352 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
34353 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
34354 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
34355 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
34356 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
34357 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
34358 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34359 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
34360 }
34361 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
34362 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
34363 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
34364 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
34365 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
34366 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
34367 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
34368 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
34369 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
34370 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
34371 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
34372 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
34373 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
34374 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
34375 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
34376 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
34377 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
34378 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
34379 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
34380 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
34381 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
34382 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
34383 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
34384 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
34385 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
34386 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
34387 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
34388 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
34389 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
34390 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
34391 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
34392 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
34393 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
34394 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
34395 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
34396 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
34397 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
34398 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
34399 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
34400 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
34401 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
34402 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
34403 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
34404 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
34405 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
34406 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
34407 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
34408 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
34409 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
34410 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
34411 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
34412 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
34413 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
34414 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
34415 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
34416 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
34417 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
34418 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34419 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
34420 }
34421 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
34422 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
34423 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
34424 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
34425 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34426 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
34427 }
34428 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
34429 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
34430 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34431 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
34432 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
34433 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
34434 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
34435 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
34436 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
34437 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
34438 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
34439 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
34440 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
34441 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
34442 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
34443 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
34444 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
34445 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
34446 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
34447 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
34448 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
34449 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
34450 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
34451 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
34452 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
34453 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
34454 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
34455 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
34456 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
34457 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34458 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
34459 }
34460 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
34461 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
34462 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
34463 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
34464 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
34465 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
34466 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
34467 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
34468 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
34469 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
34470 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
34471 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
34472 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
34473 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
34474 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
34475 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
34476 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
34477 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
34478 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
34479 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
34480 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
34481 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
34482 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
34483 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
34484 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
34485 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
34486 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
34487 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
34488 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
34489 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
34490 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
34491 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
34492 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
34493 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
34494 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
34495 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
34496 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
34497 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
34498 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
34499 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
34500 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
34501 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
34502 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
34503 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
34504 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
34505 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
34506 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
34507 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
34508 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
34509 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
34510 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
34511 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
34512 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
34513 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
34514 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
34515 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
34516 PING_DATA::ID => PING_DATA::EXTRA_CRC,
34517 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
34518 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
34519 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
34520 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34521 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
34522 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
34523 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
34524 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
34525 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
34526 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
34527 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
34528 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
34529 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
34530 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
34531 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
34532 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
34533 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
34534 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
34535 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
34536 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
34537 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
34538 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
34539 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
34540 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
34541 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
34542 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
34543 SCRIPT_COUNT_DATA::ID => SCRIPT_COUNT_DATA::EXTRA_CRC,
34544 SCRIPT_CURRENT_DATA::ID => SCRIPT_CURRENT_DATA::EXTRA_CRC,
34545 SCRIPT_ITEM_DATA::ID => SCRIPT_ITEM_DATA::EXTRA_CRC,
34546 SCRIPT_REQUEST_DATA::ID => SCRIPT_REQUEST_DATA::EXTRA_CRC,
34547 SCRIPT_REQUEST_LIST_DATA::ID => SCRIPT_REQUEST_LIST_DATA::EXTRA_CRC,
34548 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
34549 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
34550 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
34551 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34552 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
34553 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34554 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
34555 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
34556 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34557 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
34558 }
34559 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34560 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
34561 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
34562 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
34563 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
34564 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
34565 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
34566 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
34567 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
34568 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
34569 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
34570 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
34571 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
34572 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
34573 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34574 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
34575 }
34576 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34577 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
34578 }
34579 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
34580 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
34581 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
34582 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
34583 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
34584 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
34585 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
34586 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
34587 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
34588 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
34589 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
34590 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
34591 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
34592 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
34593 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
34594 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
34595 _ => 0,
34596 }
34597 }
34598 fn target_system_id(&self) -> Option<u8> {
34599 match self {
34600 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
34601 Self::CANFD_FRAME(inner) => Some(inner.target_system),
34602 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
34603 Self::CAN_FRAME(inner) => Some(inner.target_system),
34604 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
34605 Self::COMMAND_ACK(inner) => Some(inner.target_system),
34606 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
34607 Self::COMMAND_INT(inner) => Some(inner.target_system),
34608 Self::COMMAND_LONG(inner) => Some(inner.target_system),
34609 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
34610 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
34611 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
34612 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
34613 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
34614 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
34615 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
34616 Self::LOGGING_ACK(inner) => Some(inner.target_system),
34617 Self::LOGGING_DATA(inner) => Some(inner.target_system),
34618 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
34619 Self::LOG_ERASE(inner) => Some(inner.target_system),
34620 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
34621 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
34622 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
34623 Self::MISSION_ACK(inner) => Some(inner.target_system),
34624 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
34625 Self::MISSION_COUNT(inner) => Some(inner.target_system),
34626 Self::MISSION_ITEM(inner) => Some(inner.target_system),
34627 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
34628 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
34629 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
34630 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
34631 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
34632 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
34633 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
34634 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
34635 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
34636 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
34637 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
34638 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
34639 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
34640 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
34641 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
34642 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
34643 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
34644 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
34645 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
34646 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
34647 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
34648 Self::PARAM_SET(inner) => Some(inner.target_system),
34649 Self::PING(inner) => Some(inner.target_system),
34650 Self::PLAY_TUNE(inner) => Some(inner.target_system),
34651 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
34652 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
34653 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
34654 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
34655 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
34656 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
34657 Self::SCRIPT_COUNT(inner) => Some(inner.target_system),
34658 Self::SCRIPT_ITEM(inner) => Some(inner.target_system),
34659 Self::SCRIPT_REQUEST(inner) => Some(inner.target_system),
34660 Self::SCRIPT_REQUEST_LIST(inner) => Some(inner.target_system),
34661 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
34662 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
34663 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
34664 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
34665 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
34666 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
34667 Self::SET_MODE(inner) => Some(inner.target_system),
34668 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
34669 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
34670 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
34671 Self::TIMESYNC(inner) => Some(inner.target_system),
34672 Self::TUNNEL(inner) => Some(inner.target_system),
34673 Self::V2_EXTENSION(inner) => Some(inner.target_system),
34674 _ => None,
34675 }
34676 }
34677 fn target_component_id(&self) -> Option<u8> {
34678 match self {
34679 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
34680 Self::CANFD_FRAME(inner) => Some(inner.target_component),
34681 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
34682 Self::CAN_FRAME(inner) => Some(inner.target_component),
34683 Self::COMMAND_ACK(inner) => Some(inner.target_component),
34684 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
34685 Self::COMMAND_INT(inner) => Some(inner.target_component),
34686 Self::COMMAND_LONG(inner) => Some(inner.target_component),
34687 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
34688 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
34689 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
34690 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
34691 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
34692 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
34693 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
34694 Self::LOGGING_ACK(inner) => Some(inner.target_component),
34695 Self::LOGGING_DATA(inner) => Some(inner.target_component),
34696 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
34697 Self::LOG_ERASE(inner) => Some(inner.target_component),
34698 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
34699 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
34700 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
34701 Self::MISSION_ACK(inner) => Some(inner.target_component),
34702 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
34703 Self::MISSION_COUNT(inner) => Some(inner.target_component),
34704 Self::MISSION_ITEM(inner) => Some(inner.target_component),
34705 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
34706 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
34707 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
34708 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
34709 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
34710 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
34711 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
34712 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
34713 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
34714 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
34715 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
34716 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
34717 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
34718 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
34719 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
34720 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
34721 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
34722 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
34723 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
34724 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
34725 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
34726 Self::PARAM_SET(inner) => Some(inner.target_component),
34727 Self::PING(inner) => Some(inner.target_component),
34728 Self::PLAY_TUNE(inner) => Some(inner.target_component),
34729 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
34730 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
34731 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
34732 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
34733 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
34734 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
34735 Self::SCRIPT_COUNT(inner) => Some(inner.target_component),
34736 Self::SCRIPT_ITEM(inner) => Some(inner.target_component),
34737 Self::SCRIPT_REQUEST(inner) => Some(inner.target_component),
34738 Self::SCRIPT_REQUEST_LIST(inner) => Some(inner.target_component),
34739 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
34740 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
34741 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
34742 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
34743 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
34744 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
34745 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
34746 Self::TIMESYNC(inner) => Some(inner.target_component),
34747 Self::TUNNEL(inner) => Some(inner.target_component),
34748 Self::V2_EXTENSION(inner) => Some(inner.target_component),
34749 _ => None,
34750 }
34751 }
34752}